title: Stored procedure bit parameter activating additional where clause to check for null
body: <p>I have a stored procedure that looks like:</p>
  
  <pre><code>CREATE PROCEDURE dbo.usp_TestFilter
    @AdditionalFilter BIT = 1
  AS
    SELECT *
    FROM dbo.SomeTable T
    WHERE
      T.Column1 IS NOT NULL
      AND CASE WHEN @AdditionalFilter = 1 THEN
        T.Column2 IS NOT NULL
  </code></pre>
  
  <p>Needless to say, this doesn't work. How can I activate the additional where clause that checks for the @AdditionalFilter parameter? Thanks for any help.</p>