Collections:
"IS NULL" - Testing NULL Values in SQL Server
How To Test NULL Values Properly in SQL Server Transact-SQL?
✍: FYIcenter.com
From previous tutorials, you learned that comparing expressions with NULL will always result NULL. So you can not use comparison operators to test if an expression represents a NULL value or not.
To test expressions for NULL values, you should use one of the following special operators:
expression IS NULL -- Returns TRUE if the expression is a NULL value expression IS NOT NULL -- Returns TRUE if the expression is not a NULL value
The tutorial script below shows you how to use IS NULL and IS NOT NULL:
IF 0 IS NULL PRINT 'TRUE' ELSE PRINT 'FALSE'; GO FALSE IF NULL IS NULL PRINT 'TRUE' ELSE PRINT 'FALSE'; GO TRUE IF 1+NULL IS NULL PRINT 'TRUE' ELSE PRINT 'FALSE'; GO TRUE IF 'NULL' IS NOT NULL PRINT 'TRUE' ELSE PRINT 'FALSE'; GO TRUE
⇒ ISNULL() - Replacing NULL Values in Expressions in SQL Server
⇐ NULL Values Involved in Boolean Operations in SQL Server
2017-02-03, 2730🔥, 0💬
Popular Posts:
What Are Bitwise Operations in SQL Server Transact-SQL? Bitwise operations are binary operations per...
How to obtain the version number of the ICU (International Components for Unicode) library using the...
How To Install Oracle Database 10g XE in Oracle? To install 10g universal edition, double click, Ora...
What are single-byte character string data types supported in SQL Server Transact-SQL? Single-byte c...
What Privilege Is Needed for a User to Delete Rows from Tables in Another Schema in Oracle? For a us...