How to Check for NULL value in a Query in SQL Server ?

You might want to check if a column contains a NULL value or NOT and filter the rows. You can use the IS NULL and IS NOT NULL keywords in SQL Server to perform the NULL check.

How to Check for NULL value in a Query in SQL Server ?

The NULL values cannot be easily identified using the = operator because the NULL refers to NO value. Using the IS NULL in SQL Server performs this NULL check to return true when the value of the column is NULL.

For example , if you want to retrieve the Employee records where the column organizationNode column contains NULL value , the query will be as follows.

use AdventureWorks2014
GO
SELECT * FROM HumanResources.Employee
where OrganizationNode IS NULL

The output of the above query is

How to Check for NULL value in a Query in SQL Server ?