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:

  1. IS NULL
  2. IS NOT NULL
  3. ISNULL() Function
  4. NOT ISNULL() Function
  5. DATALENGTH()
  6. 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.

Similar Reads

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:...

Methods for Identifying NULL or Empty Values in SQL Server

Explained below with examples, the above five methods....

Conclusion

In this article, we have discussed in detail about records with NULL, EMPTY(”), and SPACES (‘ ‘) values and how to filter records without these values. We have seen 6 types of keywords or Functions to filter records with or without NULL, EMPTY and SPACE values based on the query result required. Checking for NULL values is very important in many situations to avoid NULL value error. Whenever situation requires check for NULL value in a column before doing any data manipulations to avoid errors....