Include column headers in the resultset

A question that I am often asked when I do a presentation is how I configure SSMS so that when the query is executed the query is displayed in the header of the messages. I find that when presenting it can be easier to talk to the output rather than flicking back to the Query Editor.

Below is an example of the statement being displayed in the header of the messages:

To configure this is SSMS follow the steps below:

  1. Open SSMS
  2. Select Tools | Options
  3. Expand Query Results
  4. Expand SQL Server
  5. Select Results to Text
  6. Check Include the query in the result set