Home All Groups Group Topic Archive Search About
Author
22 Dec 2005 7:36 AM
VV
I'm trying to merge two or more database records. For example:

id | doc (type xml)
1    <s><t id="2"><p n="1">Something</p></t></s>
2    <s><t id="3"><p n="1">Something</p></t></s>
3    <s><t id="3"><p n="2">Something</p></t></s>

what I need to get is this:

<s>
<t id="2">
    <p n="1">Something</p>
</t>
<t id="3">
    <p n="1">Something</p>
    <p n="2">Something</p>
</t>
</s>

Could this be done on SQL Server 2005 using xquery!? Any suggestions?!

AddThis Social Bookmark Button