Search code examples
comparessmsvarchar

how to compare varchar value in SQL server management studio


I can compare the values of varchar by using "LIKE" . For example

 CompanyName like 'google'

how can I compare it for dissimilarity. i.e, I want do 'companyName' is not equal to "google". How can I do it??


Solution

  • You can use the NOT operator to achieve this:

    CompanyName not like '%google%'