SQL Server Central is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

Include Column Headers From SSMS

By Ken Simmons, 2008/06/13

Total article views: 2182 | Views in the last 30 days: 46

I used to be able to select columns in Enterprise Manager and copy the results to an Excel spreadsheet and it would include the headers. When I did the same thing in SQL Server Management Studio the headers did not copy. I write a lot of ad hoc queries and copy the results to Excel. Now I was having to type the headers and this was causing me a lot of extra work.

I accidentally stumbled across the option one day when I was trying to remove the column headers in the text results. The functionality does exist in SQL 2005, but it is not enabled by default.

First navigate to the Tools->Options menu in SSMS.
Under the Query Results->SQL Server->Results to Grid you will see an option to "Include column headers when copying or saving the results".

 

Select the option and click OK. You will then have to open a new query editor window for the changes to apply.

 

Now you can copy and paste the results and the headers will be included.

 

Conclusion

There are several options that are configurable in SSMS. If you think you are missing functionality that existed in older versions, the options are a good place to start. If you look around, you will find some very useful new features.

By Ken Simmons, 2008/06/13

Total article views: 2182 | Views in the last 30 days: 46
Your response
 
 
Related tags
 
Related content

What does SMO mean in SQL Server 2005?

(not yet rated) | 1,990 reads

What is database mirroring?

By Steve Jones | Category: SQL Server 2005
(not yet rated) | 2,310 reads

What is the role of a witness in...

By Steve Jones | Category: SQL Server 2005
(not yet rated) | 1,399 reads
Already registered?  

Free registration required

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Register

E-mail address:
Password:
Password (confirm):

  

Subscriptions

We ask you to register on the site and subscribe to our newsletters. Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

We ask that you give the newsletter a try for a week. Over 200,000 SQL Server Professionals a day find it entertaining and useful. If not, you are welcome to unsubscribe at anytime.

Steve Jones
Editor, SQLServerCentral.com