SSMS Query Results: “Include column headers when copying or saving the results"

In my work with external customers, I collaborate with some excellent DBAs & Architects.  But I've noticed many of them are not aware that you can capture column headers from query results to grid in SSMS.

When a very bright engineer I work with—not a SQL SME yet one of the smartest guys I know—told me he didn't know about it either, I decided to document the simple protocol.  I'm not the first person to post this topic, but I wouldn't need to do so if everyone already knew about it.

There are two ways to get the column headers from SSMS into, say, Excel.

The Hard Way 

You can simply type out the column names by hand.

The Right Way

Make it the SSMS default:

  • Open SSMS
  • Click Tools > Options
  • In the Options dialog, expand Query Results > SQL Server > Results to Grid, then check “Include column headers when copying or saving the results”
  • Click OK
  • Close & restart SSMS


As my friend the cellist says, "Viola!"

The steps are the same for SQL Server 2005 & 2008.

Additional Resources

Explore these topics for additional information on SSMS options & increase your SSMS productivity.


Jimmy May, MCDBA, MCSE, MCITP: DBA + DB Dev | Senior Performance Consultant: SQL Server
A.C.E.: Assessment Consulting & Engineering Services
Oh, the weather outside is frightful, but SQL Server is delightful! —Brian Moran

This post was written with the plugin for Windows Live Writer

Comments (8)

  1. Alik Levin says:

    Jimmy, I am huge fan of simple but practical tips like the one you share here.

    Very useful – thanks for sharing!

  2. Jimmy May says:

    @alikl:  You’re welcome.  Here are some of the other defaults I change in the SSMS Options dialog:

    Line numbers: Text Editor > Plan Text > General

    Tab behavior: Text Editor > Plan Text > Tabs

    Keyboard shortcuts for SProcs: Environment > Keyboard

    The later is a *huge* productivity enhancement.  I’ll blog about it sometime.

  3. In SSMS 2008 you can also right click on the results grid and choose "Copy with Headers". No options changes are required for it to work.

  4. chris says:

    Thanks for this very useful tip.  I was using DBArtisan just because it copies the col headers, but with this setting I can stay with SQL Serv.

    Best Regards,


  5. roger helms says:

    Having the column headers included with the copied results is very helpful, but my version of SQL defaults to not including them, and my brain defaults to forgetting to reset the option.  Can saving the col. headers be set as the Query Options default?  thanks, Roger

  6. Jimmy May says:

    Roger, I’m not sure what you’re asking here.  That’s the whole point of my post, to configure it as a default option for SSMS. 😉  Please clarify.

  7. Chris Hanson says:

    Many thanks, I have been having this problem for ages and had been either typing them or setting it manully each time with a right click, NB surely this should have been the factory default?

  8. Richard Dingwall says:

    Thanks for the tip. It was not clear that you have to restart SSMS for this to take effect. (Using SSMS 2012)

Skip to main content