title: @var IS Null condition causing clustered index scans
body: <p>I have a query</p>
  <pre><code>Select Column1, column2.... column30 
  From Table 
  Where (@var IS NULL OR Col1 = @var)
  </code></pre>
  <p>This can get resolved to a clustered index scan where every row in a table getting checked against this condition @var IS NULL and the index set up on the column Col1 is disregarded. Is there a way to re-write this query to enable the optimizer to use the index on col1? Thank you!</p>