I would like to know how to use NULL and an empty string at the same time in a WHERE clause in SQL Server. I need to find records that have either null values o
WHERE
To find rows where col is NULL, empty string or whitespace (spaces, tabs):
NULL
SELECT * FROM table WHERE ISNULL(LTRIM(RTRIM(col)),'')=''
To find rows where col is NOT NULL, empty string or whitespace (spaces, tabs):
NOT NULL
SELECT * FROM table WHERE ISNULL(LTRIM(RTRIM(col)),'')<>''