woensdag 16 mei 2012

SQL Server XML Column

If you want to search for text in an XML column you can't use the Like keyword, but you can use Contains:



SELECT [columns]
FROM TabvleWithXmlColumn
where [XmlColumnname].exist('/root/element[contains(., "[search text]")]') = 1

Be aware this is very slow when you have a lot of records.