title: Creating a T-sQL where clause to accept NULL values
body: <p>Now I am developing a stored proc which takes 3 input parameters.  But the challenge is that the customer doesn't have to enter any of these parameters; they may instead have these 3 as nulls.  How can I write this into the WHERE clause?</p>
  
  <p>pseudocode is something like:</p>
  
  <pre><code>WHERE (@p1 = a.p1 or @p1 = '') 
  and (@p2 = a.p2 or @p2 = '') 
  and (@p2 = a.p2 or @p2 = '')
  </code></pre>
  
  <p>The above logic works when they choose all 3 parameters, but otherwise it returns 0 records.</p>