Forums - C# Corner

Forum guidelines
Sreekanth Reddy

Sreekanth Reddy

  • 405
  • 4.3k
  • 213.7k

Fetch only not null columns from a table.

Feb 11 2019 1:44 AM
How to fetch only not null columns from a table in sql server ?
For Example : Let us think there are 3 columns x1, x2 and x3 with 10 records.
If all the 10 record values of x3 column are null, Then I dont want to display that column. Only x1 and x2 needs to gets displayed.
I dont want to go for looping technique.

Answers (4)