« TechEd 2005, Chennai | Main | Uninstalling .NET 2.0 Beta1 »
How to use Nulls..
Came upon this interesting article called the Four rules for Nulls. Some of the places where the books online is not exactly correct is pointed out in this article. The most helpful aspect of this article is that it puts together in a single place the best practices to be used in working with NULLs.
Rule #1: Use NULLs to indicate unknown/missing information only. Do not use NULLs in place of zeroes, zero-length strings or other "known" blank values. Update your NULLs with proper information as soon as possible. Rule #2: In ANSI SQL, NULL is not equal to anything, even other NULLs! Comparisons with NULL always result in UNKNOWN.
Rule #3: Use SET ANSI_NULLS ON, and always use ANSI Standard SQL Syntax for NULLs. Straying from the standard can cause problems including portability issues, incompatibility with existing code and databases and returning incorrect results.
Rule #4: The ANSI Standard COALESCE() and CASE syntaxes are preferred over ISNULL() or other proprietary syntax.
June 30, 2005 in SQL Server by Anand M | Permalink
TrackBack
TrackBack URL for this entry:
http://www.typepad.com/t/trackback/1248/2740036
Listed below are links to weblogs that reference How to use Nulls..:


