How to: Copy “Column Header” in SQL 2008 SSMS, SQL 2005 SSMS and SQL 2000 Enterprise Manager

SQL Server Management Studio 2008

SQL Server Management Studio 2008 (SSMS) has never failed to surprise me with it’s little (yet useful) enhancements. Here’s adding to the list:

As a common need, you are required to Save/Copy SSMS query output to other files (E.g. Excel). This however had a limitation that you could NOT copy the ‘Column Headers’.

In SQL Server Management Studio 2008, you can actually Copy “Column Headers” from query results window. Here’s how:

1. In SSMS, Result window. Right-Click on column name

2. Select Copy with Header option (refer below screen)

copy_with_header

What’s more, you can manage SQL 2005 database from SQL 2008 Management Studio and get benefits of SSMS enhancements, like one above.

SQL Server Management Studio 2005

For SQL Server 2005 SSMS, follow below steps:

1.  SSMS Tools –> Options –> Query Results –> SQL Server –> Result to Grid

2. Check –> “Include column headers when copying or saving to result

image

SQL Server 2000 Enterprise Manager

For SQL Server 2000 Enterprise Manager, follow below steps:

1. Enterprise Manager –> Tools –> SQL Server Query Analyzer –>  Tools –>  Options –>  Results

2. Default results Target : “Results to Text”

3. Results output format : “Tab Delimited”

4. Print column headers : Checkbox ON(check)

image

Try, You Got to Enjoy It !

Disclaimer: I work at Microsoft. Everything here, though, is my personal opinion and is not read or approved by Microsoft before it is posted. No warranties or other guarantees will be offered as to the quality of the opinions or anything else offered here.