title: returning column names in a query in sql
body: <p>I have a query that looks something like this:</p>
  
  <pre><code>select * 
  from resident 
  where Resident_Sex is null or Resident_Date_Of_Birth is null or race_code is null.
  </code></pre>
  
  <p>not always is it only checking if 3 columns are null, it may have more. 
  I want to know if there is a way, instead of selecting * from this table, to select lets say the resident id and the column name that he is missing.</p>
  
  <p>for example, it should return</p>
  
  <pre><code>resident_id column_name
  ----------- ------------
  aaaaaaa     resident_sex
  bbbbbbb     resident_sex
  bbbbbbb     race_code   
  ccccccc     resident_date_of_birth
  </code></pre>
  
  <p>instead of returning</p>
  
  <pre><code> resident_id resident_sex race_code   Resident_date_of_birth
   ----------- ------------ ----------- -----------------------
   aaaaaaa     null         158         1995-02-18 00:00:00.000
   bbbbbbb     null         null        1928-07-15 00:00:00.000
   ccccccc     F            12          null     
  </code></pre>
  
  <p>Obviously there are alot more rows and columns in the table so I cannot do any case or if statements...</p>
  
  <p>I hope I made myself clear... 
  thank you in advance!</p>