I’m working on a data quality workflow where I validate incoming records for null or missing values.
Even when a column clearly contains nulls, my rule doesn’t trigger and the record passes validation.
Here’s the logic I’m using:
CASE
WHEN column_name IS NULL THEN 'FAIL'
ELSE 'PASS'
END
But NULL records still return PASS.
Things I’ve checked:
The column datatype is VARCHAR
The source file is CSV
Some values look empty (
"") but not sure if they are treated as NULLMy question:
Is there a difference between empty string and NULL in SQL during validation? If so, how can I reliably detect actual NULL vs whitespace vs empty string?
case when column_name <> '' then 'PASS' else 'FAIL' end, will return FAIL for both empty strings and null values.