Monday, 22 December 2014

How to search Special character in SQL SERVER


How can i search special character in column

  Create table test
  (
       ID int,
       ProductName varchar(100)
  )

  Insert into test values (1,'hey%boss')
  Insert into test values (1,'helloboss')
  Insert into test values (1,'hiboss')


  Select * From test
  Where ProductName like '%[%]%'


  Select * From test
  Where ProductName like '%\%%' ESCAPE '\'




No comments:

Post a Comment