T-SQL Question : Query to XML
- by Juvil John Soriano
anyone can show me how to generate from this data
------------------------DATA--------------------------
Key ParentKey
5 NULL
25 5
33 25
26 5
27 5
34 27
28 5
29 5
to this XML result?
---------------------RESULTS--------------------------
<record key="5" parentkey = "">
<record key="25" parentkey = "5">
<record key="33" parentkey = "25"></record>
</record>
</record>
<record key="25" parentkey = "5">
<record key="26" parentkey = "5">
<record key="27" parentkey = "5">
<record key="34" parentkey = "27"></record>
</record>
</record>
<record key="28" parentkey = "5">
<record key="29" parentkey = "5">
</record>