title: T-SQL: check if variable is null
body: <p>I'm wondering if there is a way to check if variable <code>@varChar</code> is <code>NULL</code> <strong>and</strong> variable <code>@bit</code> is <code>0</code>.</p>
  
  <p>My attempt:</p>
  
  <pre><code>if ISNULL(@varChar, false) and (@bit = 0) 
  begin
      RAISERROR ('varchar was not specified', 16,1);
  end
  </code></pre>
  
  <p>My problem is that <code>ISNULL(check_if_null, replacement_value)</code> does not work like this, and I can not find an alternative.</p>