Problem
One of the nice features with SQL Server Management Studio is the ability to create result sets from queries into a grid result set. This data can then be copied and pasted in other application such as Excel. The downside to saving the results in a grid is that the column headers don’t get copied along with the data. To get around this you could query the data in the text format, so you could copy the results along with the column headers, but then you are faced with formatting issues.
Solution
You have the ability to copy the column headers along with the data results with two different options.
SQL Server Management Studio Query Options Setting
First is a query options setting. To access this setting from SQL Server Management Studio, select Query > Query Options from the menus and you will see the following screen:

Select the Results / Grid setting and check “Include column headers when copying or saving the results”. Once this is set whatever query you run and then if you select the results and copy and paste into another application the column headers are also copied along with the data.
Here is a sample query:
SELECT TOP 5 name, id, crdate FROM dbo.sysobjectsResults copied with column headers off:
| sysrowsetcolumns | 4 | 10/14/05 1:36 |
| sysrowsets | 5 | 10/14/05 1:36 |
| sysallocunits | 7 | 10/14/05 1:36 |
| sysfiles1 | 8 | 4/8/03 9:13 |
| syshobtcolumns | 13 | 10/14/05 1:36 |
Results copied with the column headers on:
| name | id | crdate |
| sysrowsetcolumns | 4 | 10/14/05 1:36 |
| sysrowsets | 5 | 10/14/05 1:36 |
| sysallocunits | 7 | 10/14/05 1:36 |
| sysfiles1 | 8 | 4/8/03 9:13 |
| syshobtcolumns | 13 | 10/14/05 1:36 |
SSMS Save Results with Headers
A second way to have SSMS save results with headers is to right click on the grid result set and select Copy with Headers or use Ctrl+Shift+C as shown below.

Next Steps
- This is a simple little tip, but could save you time and headaches trying to get the column headers copied.
- SQL Server Management Studio 22 Download
- SQL Server Management Studio FAQ

Greg Robidoux has been working with databases for 35+ years with extensive hands on SQL Server experience from version 6.5 to 2025. He has authored over 250 technical articles and delivered several presentations online and at various conventions. Greg is also the President and founder of Edgewood Solutions, a technology services company delivering services and solutions for Microsoft SQL Server.


