Sunday, November 8, 2009

T-SQL - NULL does not equal NULL

Be careful of this when coding. NULL does not equal NULL, you can test it with following code, weird? No! because NULL does not present a value to be able to be equal to another value!

IF (NULL=NULL)
PRINT 'NULL is equal to NULL'
ELSE
PRINT 'NULL is not equal to NULL !'

Share/Bookmark

No comments: