Search XML with a LIKE or similar full search operation

shrump

New Member
I want to search an XML valued column to see if a contains a string. I don't know the schema, I want to know if the string is contained anywhere at all. I don't know if XPATH would work in this situation.The equivalent of\[code\]Select s.Name, ts.ValueXML from table t (nolock) join table2 ts (nolock) on t.key_Id = ts.key_Idjoin table3 s (nolock) on ts.key_Id=s.key_Idwhere s.Name like '%Lab%' and ts.ValueXML like '%PreviewDateRange%'\[/code\]\[quote\] ERROR: Argument data type xml is invalid for argument 1 of like function.\[/quote\]relevant \[code\]ts\[/code\] Table columns\[code\]ValueXml (XML(.), null)\[/code\]The item I'm searching for should be an attribute. So if the above isn't possible, then anything containing that attribute would be a good alternative.
 
Back
Top