title: Indexing does not work with LIKE and NOT operator in Sql Server, Is it a MYTH
body: <p>I have seen in many articles on Sql Server which states that when we are writing a query we should avoid using NOT and LIKE operator in our query because indexing is not applied on it.</p>
  
  <p>eg.</p>
  
  <pre><code>  SELECT [CityId]
        ,[CityName]
        ,[StateId]
    FROM [LIMS].[dbo].[City]
    WHERE CityId NOT IN(1, 2)
  </code></pre>
  
  <p>I executed above query and found that indexing was getting used to filter the records.
  Following is the execution plan, which clearly shows Clustured Index seek. This clearly violates what I used to think and read. </p>
  
  <p><img src="https://i.stack.imgur.com/qpr1e.jpg" alt="enter image description here"></p>
  
  <p>Was my previous understanding incorrect ?</p>