I have a table with following columns: F1, F2, ...F10 Some of these columns contain only NULLS, let's say they are F2 and F7. How can I get a string with the names of these columns, I would like to get 'F2,F7' as a return value. This is a temporary table and column names and the number of columns is unknown. I need some very generic function to extract the column names containing NULLs
NOTE: I know it is fairy easy in Oracle using some system objects (i.e. all_tab_columns, etc), not sure if possible in SQL Server as well.
Thank you.