This will select all rows where some_col is NULL or '' (empty string)

SELECT * FROM table WHERE some_col IS NULL OR some_col = '';
Answer from maček on Stack Overflow
🌐
W3Schools
w3schools.com › sql › sql_null_values.asp
SQL NULL Values - IS NULL and IS NOT NULL
SELECT column_names FROM table_name WHERE column_name IS NOT NULL; Below is a selection from the Customers table used in the examples: The IS NULL operator is used to test for empty values (NULL values).
🌐
GeeksforGeeks
geeksforgeeks.org › sql server › how-to-check-a-column-is-empty-or-null-in-sql-server
How to Check a Column is Empty or Null in SQL Server - GeeksforGeeks
January 31, 2024 - If we check the below query you can understand this as this column has EMPTY ('') and SPACES (' ') Select * from StudentsInfo WHERE Remarks IS NOT NULL
🌐
Baeldung
baeldung.com › home › sql queries › find null or empty values in sql
Find Null or Empty Values in SQL Baeldung on SQL
August 20, 2025 - To catch such rows, we can trim ... the first non-NULL value from a list of arguments. COALESCE(code, ”) returns the value of the column code if it is not NULL....
🌐
SQLServerCentral
sqlservercentral.com › forums › topic › check-the-variable-is-empty-or-null
Check the Variable is Empty or Null – SQLServerCentral Forums
September 9, 2014 - This is because in SQL Server, the unknown/missing/null is regarded as the lowest possible value. ... Cool. I never knew you could do that, very interesting :laugh: Edit: sql code tag messed up my "greater than" symbol. You may do it... sometimes... But it is NOT right. Try this: ... If you want to make sure that your varchar value contains some thingelse than NULL and empty string use simple "NOT EQUAL" eg:
🌐
DevArt
blog.devart.com › home › how to › how to handle null or empty values in sql server
How to Handle Null or Empty Values in SQL Server
December 19, 2024 - The NULLIF function compares two expressions and returns NULL if they are equal. When applied to a column containing an empty value, it returns NULL, allowing us to check for NULLs using the IS NULL operator:
Find elsewhere
🌐
Reddit
reddit.com › r/sqlserver › counting rows where all columns are either null or empty in the row?
r/SQLServer on Reddit: Counting rows where ALL columns are either null or empty in the row?
September 26, 2024 -

I'd rather not write a bunch of AND clauses, so is there a quick, efficient way to do this?

I'm importing some data with 10 fields into a SQL Server from a CSV file. Occasionally this file has null/empty values across all the cells/columns.

What I'd like to do is just write one relatively short sql statement to simply count (at first) all these rows. I'd rather do it without doing something like:

...and (column1 is null or column1 = '')
...and (column2 is null or column2 = '')

etc...

Is there a good way to do this, or am I stuck with the above?

🌐
Quora
quora.com › How-do-you-check-if-a-column-is-blank-in-SQL
How to check if a column is blank in SQL - Quora
Answer (1 of 3): SELECT * FROM table_name WHERE column_name IS NULL; Or, SELECT * FROM table_name WHERE column_name IS NULL AND column_name LIKE '””; (Note: put begining and ending quotes without any text/ space in 2nd Query.
🌐
Microsoft Learn
learn.microsoft.com › en-us › sql › t-sql › queries › is-null-transact-sql
IS NULL (Transact-SQL) - SQL Server | Microsoft Learn
To determine whether an expression is NULL, use IS NULL or IS NOT NULL instead of comparison operators (such as = or !=). Comparison operators return UNKNOWN when either or both arguments are NULL.
🌐
SQLServerCentral
sqlservercentral.com › forums › topic › check-for-null-or-empty-values-and-return-0
Check for null or empty values and return 0 – SQLServerCentral Forums
March 13, 2014 - I would also use LTRIM and RTRIM to get rid of extra spaces i.e. coalesce(nullif(rtrim(ltrim(column)),''),0) Microsoft Certified Master - SQL Server 2008 Follow me on twitter: @keith_tate · Forum Etiquette: How to post data/code on a forum to get the best help[/url] ... Can you show an example. I am bit confused how to apply this into my query. ... Coalesce will return the first non-NULL value, so if the sum Previous_Year + Current_Year returns a NULL value it will go to the next value in the comma delimited list in this case 0.
🌐
ASPSnippets
aspsnippets.com › questions › 125379 › Check-Column-value-is-Null-or-Empty-Blank-in-SQL-Server-using-Case-Statement
Check Column value is Null or Empty Blank in SQL Server using Case Statement
March 17, 2022 - How can I combine the two nulls ... One from Preparedataconvert where days='Tuesday' ... You need to use SQL CASE Statement in your query and check condition....
🌐
Coginiti
coginiti.co › home › beginner › sql is null
What is the IS NULL Operator in SQL? - Coginiti
September 25, 2023 - In addition to the IS NULL operator, SQL also provides the IS NOT NULL operator, which is used to test for non-NULL values in a column. ... As a result, you would see the rows that are not empty or do not have NULL values.
🌐
Darling Data
erikdarling.com › home › blog › the right way to check for nulls in sql server queries
The Right Way To Check For NULLs In SQL Server Queries | Darling Data
May 16, 2022 - I like to make sure a column returned from a select doesn’t have a NULL value if it is a nullable column when the query is in an application. Much easier to handle this with a ISNULL(columnname,”) AS NoErrorBombsHere than to have to add error handling code throughout my application to handle NULL values. Yeah, it’s a lot different in the select list than in the where clause (unless you have nested selects and filter on the expression). This is a great article about null.
🌐
Mimo
mimo.org › glossary › sql › is-not-null
SQL IS NOT NULL Condition: Syntax, Usage, and Examples
In SQL Server, you can use IS NOT NULL inside WHERE, CASE, JOIN, and HAVING clauses. The syntax is the same as in other databases: ... You can also pair it with the ISNULL() function if you want to display a placeholder when a value is missing but still filter the valid ones: