Tags

, ,

Sometimes you would need to search certain keyword inside a XML column using a like clause, here is a simple example:

SELECT XmlColumn, OtherColumns FROM TableWithXmlColumn
WHERE cast(XmlColumn as varchar(max)) LIKE '%keyword%'

MSDN Reference: https://msdn.microsoft.com/en-us/library/ms187928.aspx

Advertisements