title: Using Null variables in conditions in T-Sql
body: <p>Is there a way to use a variable in the following manner?</p>
  
  <pre><code>DECLARE @ID int;
  SET @ID = NULL;
  SELECT *
  FROM Market market
  WHERE market.ID IS @ID
  </code></pre>
  
  <p>Or is there another way to do this?</p>
  
  <p>Thanks.</p>