title: SQL: Check for 'value' is not null returns TRUE when 'value' is null
body: <p>I am using SQL Server 2008, and when I perform a left join to a table where the outer table does not have any records then I am seeing weird behavior from my where clause.  If I do a check for a value from my outer table being 'not null' it <em>sometimes</em> returns true.</p>
  
  <pre><code>select *
  from foo f left join bar b on b.id=f.id
  where f.id=@id and (f.status = 1 or b.Price is not null)
  </code></pre>
  
  <p>When my <code>f.status = 0</code> and <code>b.Price</code> does not exist (or, appears as null in the select) this query selects records where <code>f.status = 0</code> and <code>b.Price is null</code>, even though (FALSE OR FALSE) should be FALSE.</p>
  
  <p>If I just perform this query, it works as expected and anything without a record in 'bar' does not get selected.</p>
  
  <pre><code>select *
  from foo f left join bar b on b.id=f.id
  where f.id=@id and b.Price is not null
  </code></pre>
  
  <p>Having <code>b.Price is not null</code> as part of an <code>or</code> operation seems to be causing issue for some reason.  What could be wrong with this query?  I run the same query with similar data on a SQL Server 2012 machine and do not see this issue, could it be related the the version of SQL Server I am using?</p>