title: When is "NOT" not a negation?
body: <p>Why do both of the following return zero? Surely the second is a negation of the first? I am using SQL Server 2008.</p>
  
  <pre><code>DECLARE 
      @a VARCHAR(10) = NULL ,
      @b VARCHAR(10) = 'a'
  
  SELECT  
      CASE WHEN ( ( @a IS NULL
                        AND @b IS NULL
                      )
                      OR @a = @b
                    ) THEN 1
           ELSE 0
      END , -- Returns 0
      CASE WHEN NOT ( ( @a IS NULL
                        AND @b IS NULL
                      )
                      OR @a = @b
                    ) THEN 1
           ELSE 0
      END -- Also returns 0
  </code></pre>