Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dhani
Posting Yak Master
132 Posts |
Posted - 2009-07-23 : 12:23:55
|
| Hello All,i have a table with 67 columns, is there any way to get the columns that are having all null values in itin detail: i have a table called userStatisticsTemp it has around 67 columns some of the columns has all null values , some of them were having both null as well as values & some other has just valuesso is there a any trick to know what columns has all null values rather than select each column in where clause conditionThanks in advanceBest RegardsDhani |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-07-23 : 12:33:48
|
| SELECT SUM(CASE when COLUMN_NAME is null THEN 0 Else 1 End) as NumberNonNullRecords FROM YOUR_TABLE |
 |
|
|
|
|
|