I was playing around with ESRI sde tables and one of the column was a XML column I wanted to query, like this:
- where (Definition like '%<blah>%</blah>%')
Will cause an error:
- Msg 8116, Level 16, State 1, Line 2
- Argument data type xml is invalid for argument 1 of like function.
But:
- where (cast(Definition as varchar(max)) like '%<blah>%</blah>%')
Works like a charm!
Resources:
ASP.Net Forum: Argument data type xml is invalid for argument 1 of like function
Keywords: XML, SQL, SQL Server 2008, Error