October 23, 2013 at 4:04 am
Hi,I am using Sql Server 2008 R2,
My requirement is,
I want to Execute the SP, with multiple value, which should be pass in XML format,
and this values should taken from the following table.
Create Table Temp1
(
para_namevarchar(100),
para_valuevarchar(100),
para_idint
)
Select * from Temp1
Insert Into Temp1
Values ('@AsonDate','HL', 26),
('@AsonDate','TL', 26),
My desired Output XML query shuold be,
<ROOT><PRODUCT><PDTSHRTDE>HLPDTSHRTDESC></PRODUCT>
<PRODUCT><PDTSHRTDESC>TL/PDTSHRTDESC></PRODUCT>
</ROOT>
Can any one help,how to build this xml string.
I need this urgently.
Thanks in Advance!!!!!
October 23, 2013 at 4:33 am
SELECT para_value AS "PDTSHRTDE"
FROM Temp1
FOR XML PATH('PRODUCT'),ROOT('ROOT');
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537October 23, 2013 at 4:44 am
Thanks!!!!!!!!!!!!!!!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply