title: Why doesn't "WHERE column = NULL" throw an error in SQL Server?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2490117/is-null-vs-null-in-where-clause-sql-server">IS NULL vs = NULL in where clause + SQL Server</a>  </p>
  </blockquote>
  
  
  
  <p>Consider the following code – can someone explain to me why the one query doesn’t throw an error? I can understand why it doesn’t return a record, but what is it trying to do? Remember that colA is an int. It works the same on 2000,2005 and 2008 r2</p>
  
  <pre><code>create table #foo
  ( colA int )
  
  
  insert into #foo
  (colA)
  values
  (null)
  
  select * from #foo --returns the one record we just created
  
  select * from #foo where colA = null --does not throw an error and does not return a record! why??
  select * from #foo where colA is null --returns the record
  
  drop table #foo
  </code></pre>
  
  <p>Is there ever record that could exist in this table that would return for colA = null?</p>
  
  <p>I dont have any other databases available to me at the moment to try this out - is this standard or is it behavior specific to MSSQL?</p>