Checking if a Column is Empty or NULL
In a Table Column sometimes there can be no actual or valid data and it could be NULL or Empty (”) or some space value saved. There are many methods or functions to identify the NULL or Empty values. Below are some of them:
- IS NULL
- IS NOT NULL
- ISNULL() Function
- NOT ISNULL() Function
- DATALENGTH()
- LEN()
How to Check a Column is Empty or Null in SQL Server
In SQL Server table columns, there can be times when there is NULL data or Column Value is Empty (”). When data is displayed or used in data manipulations, there could be a need to remove these records with NULL values or Empty column values or replace the NULL value with another value like EMPTY value (”) to avoid NULL value errors. There could also need to find NULL column values or Empty column data to update the NULL values or Empty values. So there needs to be some way to identify NULL and Empty column values.
In this article let us discuss in detail, how to check if a column is Empty or NULL in SQL Server, with examples and different methods.