title: "<>" vs "NOT IN"
body: <p>I was debugging a stored procedure the other day and found some logic something like this:</p>
  
  <pre><code>SELECT something
  FROM someTable
  WHERE idcode &lt;&gt; (SELECT ids FROM tmpIdTable)
  </code></pre>
  
  <p>This returned nothing. I thought it looked a little odd with the "&lt;>" so I changed it to "NOT IN" and then everything worked fine. I was wondering why this is? This is a pretty old proc and I am not really sure how long the issue has been around, but we recently switched from SQL Server 2005 to SQL Server 2008 when this was discovered. What is the real difference between "&lt;>" and "NOT IN" and has the behavior changed between Server2005 and 2008?</p>