Null Question

Copper Contributor

Hello Guys,

i am totally new and just started SQL 1 weeks age i have come across a problem in SQL

suppose i am working on huge amount of data which is unclean and i want to find NULL & i know the syntax of null but suppose i have almost 50 columns and i want to find out in which row there is NULL is there any we can find NULL or Blank field in this vast data because it will take a lot of time if i just put null syntax and writing one by one column

1 Reply

Hi @sam870 -- If I'm understanding correctly, you might be able to use the information_schema views to dynamically generate the select statements.  Take care.


select 'SELECT * FROM ['+table_schema+'].['+table_name+'] WHERE '+column_name+' IS NULL' FROM INFORMATION_SCHEMA.COLUMNS order by TABLE_NAME,ORDINAL_POSITION