I’ve got a table with an xml column called data (xml has got id node) and second table with idSecond column.
I would like to perform join between these two tables so that data[id] = secondTable.ID
What would be the syntax for this in SQL Server 2005 ?
thanks for any hints
Use
xml.value()method to project the node id, then join on the projected value. Eg:Actual syntax and xquery used depends on the schema of your tables and the XML content. If there are multiple node ids to project then use
xml.nodes()in a cross apply instead.