Home > Blogs > Careful with those NULLs

Careful with those NULLs

Posted October 13, 2010

Topics: SQL Server, Data

Many folks (including me) use NULL values in their databases. There's actually a bit of controversy on even having them - but I don't fall on the side of never using the. But you do need to exercise some care...

NULLs aren't "nothing", they aren't an empty set, they aren't a blank. They mean "undefined" or even "undefined at this time", so the big issue comes in comparing them. Be careful here! I ran into an issue last night where someone liberally used NULLs in their design, and it caused a couple of issues in the C# code. Interestingly, Steve Jones commented on this very topic this morning: http://www.sqlservercentral.com/blogs/steve_jones/archive/2010/10/13/common-sql-server-mistakes-_1320_-equals-null.aspx

So make sure you understand what NULLs are - and when to use them.

Comments

comments powered by Disqus