title: WHERE clause on NULLable columns, containg LIKE, keep index usage
body: <p>For a table with a column ColA as VARCHAR(x), how should I rewrite this condition </p>
  
  <pre><code>ColA LIKE @param + '%'
  </code></pre>
  
  <p>taking into account that:</p>
  
  <ul>
  <li>1/ ColA is NULLable.</li>
  <li>2/ @param could be NULL</li>
  <li>3/ There is an index on ColA, and it should be used for all searches</li>
  <li>4/ Avoid sp_executesql as this is part of much larger stored proc</li>
  </ul>
  
  <p>I was thinking at:</p>
  
  <pre><code>ISNULL(ColA, '') LIKE (CASE WHEN @param IS NULL THEN '%' ELSE @param + '%' END)         
  </code></pre>
  
  <p>but this will not make use of index defined on ColA.</p>