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
youe check null With IS NULL and string Empty With LEN(RTRIM(LTRIM(Column))) = 0 in
SELECT *
FROM AppInfra.Person
WHERE LEN(RTRIM(LTRIM(NationalCode))) = 0 OR NationalCode IS NULL
You can simply do this:
SELECT *
FROM yourTable
WHERE yourColumn IS NULL OR yourColumn = ''
SELECT *
FROM TableName
WHERE columnNAme IS NULL OR
LTRIM(RTRIM(columnName)) = ''
select
isnull(column,'') column, *
from Table
Where column = ''