Quick Tip: Things to remember when using NULL in where clause

Working on one of my project on asp.net and Sql Server has made me learn a lot about both of these technologies. I’ll be sharing my learning and the tricky things which I have learnt here in the form of quick tips.

Here’s the first one. Keep an sharp eye when using NULL in where clause because things wouldn’t be working correctly without you even noticing. Following are the few things which new developers tends to do wrong. And they would’t notice because Sql Server wouldn’t raise any error for these.

  1. Checking for NULL values
  2. Checking for NULL in “IN” condition

Continue reading