views:

9

answers:

3

By default when you copy/paste data from a query window in SSMS it does not copy the column headings. How can I get these headers to be copied along with the data?

+1  A: 
  1. Open Tools menu
  2. Open Options...
  3. Expand Query Results
  4. Expand SQL Server
  5. Expand Results to Grid
  6. Check Include column headers when copying or saving the results

Note that this will only work on the "New Query" types of windows -- not the "Open table" (editable) windows.

Joe Philllips
A: 

You can just right click the results, and select "Copy with headers"

AdaTheDev
Which version? I don't see the option in 2005 (yes, I just added 2005 to the question)
Joe Philllips
@Joe Phillips - SQL 2008. I couldn't remember if it was in 2005 or not as I don't have 2005 on this machine!
AdaTheDev
Thanks. That's good to know that they put some thought into this scenario in the next version :)
Joe Philllips
A: 

Results with headers was added in SSMS 2008. Ctrl-Shift-C works as well.

TTRider

related questions