I have a hard nut to crack here. I have the following XML stored in an XML field in a table -- using SQL Server 2005:
Now, I'm needing a SELECT query that will return this in the following format:Code:<root> <relationship table="Bob" source="Z"> <key column="Col1" /> <key column="Col2" /> </relationship> <relationship table="Ted" source="Y"> <key column="Col3"/> </relationship> </root>
All attempts have been futile. Any T-SQL, XQuery-ers out there?Code:Bob Z Col1 Bob Z Col2 Ted Y Col3
And yes, there are some good reasons why I'm storing data this way![]()



LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks