title: Getting List of Columns from a SQL Select statement
body: <p>Im wondering if there is anyway to get a list of the columns from a SQL Statement. Example, I have a simple SQL Statement like "Select FirstName, LastName From Customer", I want to get the list of the columns returned in the SQL Statement, which would be FirstName and LastName in this example. The SQL Statement is dynamic so it isnt known until runtime.</p>
  
  <p>Currently I go about it by creating a view in the database on the fly than using:</p>
  
  <pre><code>SELECT COLUMN_NAME FROM information_schema.columns WHERE table_name = @viewName
  </code></pre>
  
  <p>Than I drop the view.</p>
  
  <p>This seems a bit dramatic for just getting the columns for the select statement.</p>
  
  <p>Any ideas on how to go about this without creating and dropping the view?</p>
  
  <p>Thanks in advance</p>