List Rows with NULL values in a Column in SQL Server

A NULL value represents the missing data, or an unknown value. To find rows that have or that don't have NULL values in a column, use IS NULL and IS NOT NULL instead of comparison operators (=, !=, <>).

To list all rows that have NULL value in the MiddleName column in the Person.Person table in the AdventureWorks Database use this query:

USE AdventureWorks
SELECT FirstName, MiddleName, LastName
FROM Person.Person
WHERE MiddleName IS NULL

is_null_middlename

To list all rows that don't have NULL value in the MiddleName column in the Person.Person table in the AdventureWorks Database use this query:

USE AdventureWorks
SELECT FirstName, MiddleName, LastName
FROM Person.Person
WHERE MiddleName IS NOT NULL

is_not_null_middlename

Related articles:
‘Not Equal To’ comparison operators in SQL Server
List all Nullable or Non-Nullable Columns in a SQL Server Table
How to replace NULL with a different value in a query result in SQL Server