Hum Dum wrote:
SELECT @address = CONVERT(VARCHAR(150),[TEXT]) FROM OPENXML(@idoc,'/Name_Address/address', 0) where [text] is not null
AFAIK the result is having two rows returning and At a time of converting SQL might picking up the second row and converting it accordingly, As It returns two rows having one column. But I can Provide you another solution for that. To first Retrieve the result and using COALESCE you can JOIN them together to produce expected result. Here's my work for you only.
SELECT @address = COALESCE(@address+',' ,'') + [address]
FROM
(
SELECT * FROM
OPENXML (@idoc, 'Name_Address/address',3)
WITH ([address] varchar(1000) '.')
) P
SELECT @address
It's working all right.
Regards, Hiren. Microsoft Dynamics CRM My Recent Article: - Way to know which control have raised PostBack[^]