Query to list all rows based on a Searchstring in xml or string field

Madhu.B.Rokkam
Posted by Madhu.B.Rokkam under Sql Server category on | Points: 40 | Views : 861
Query to list all rows based on a Searchstring in xml or string field in a tDummyTable



Select * from tDummyTable (nolock) where strCreatedBy = 'SomeOne'
and PATINDEX('%'+ Cast(@SearchString as VARCHAR(50)) +'%', strToSearchInField) > 0
order by 1 desc

Comments or Responses

Login to post response