Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Xml to Table Conversion-Parse Duplicates

$
0
0

Hi ,

I have any xml like the following : 

DECLARE @A XML=  '<Row><TotalCombined>1000092185</TotalCombined><TotalCombined>1000010661</TotalCombined><TotalCombined>1000092209</TotalCombined><Gender>M</Gender><PriorityNum>1</PriorityNum><RoomNumber>1</RoomNumber></Row>'

I want to transfer into rows, I tried Xml data type methods , but i could retreive only first value of "totalCombined" , how do i get three rows here : 

Expected O/P :

Totalcombined  GenderPriorityNum   RoomNumber

1000092185M11
1000010661M11
1000092209M11

Please help in getting the above o/p.

Thanks

Chaithanya M


Regards Chaithu.. If it is usefull,Mark this as Answer.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>