I am using sql server 2008 r2 express. I have a table with column name 'xmlmycolumn' which is of datatype xml. I want to search for string in that whole xml. So to do this i am casting column as varchar and then i use charindex as shown below.
SELECT *
FROM mytable
WHERE ( Charindex('abc',CAST([xmlmycolumn] AS VARCHAR(MAX)))>0 )
Is there any other method other than casting the column as varchar so that performance of the query is increased?