How to get empty cell lines in mssql

advertisements

I have been trying to get the rows where cell is empty but how can i get an empty cell Its not NULL over there, its like an empty string.

05J9LJ-E    E004030 BGH/F.TB
            E004032 000080.KS
002X87-E    E004033 018880.KS

So second row, first column is like 8 spaces so how can i get these rows

SELECT column_A,column_B,column_C FROM [dbo].[table] where column_A is null

SELECT column_A,column_B,column_C FROM [dbo].[table] where column_A = ''

When i put the data

in notepad++


You can check that there are no non-space characters in the value:

SELECT column_A, column_B, column_C
FROM [dbo].[table]
WHERE column_A is null OR
      column_A NOT LIKE '%[^ ]%'

This has the advantage that you can include other characters besides spaces, if you need to.