woensdag 18 juli 2012

XML in SQL Server - Inner join


There are a few ways to do inner joins from an XML column to another table. This is the easy way which delivers very good performance:
select *
from [table1] t1
inner join [table2] t2
on  t1.[XmlColumn.exist('/myrootelement/subelement[.=sql:column("t2.id")]') = 1

Geen opmerkingen:

Een reactie plaatsen