Home > Management Studio, SQLServer > SQL Server – Copy Results with Headers – Management Studio

SQL Server – Copy Results with Headers – Management Studio

SSMS allows you copy query results with column headers. However, if you copy results by choosing "Copy" or Ctrl + C, by default it does not copy headers.

Management Studio 2008 allows you to copy data with headers by choosing "Copy with Headers" from Edit or Context Menu (or Ctrl + Shift + C).

Context Menu in 2008

image

However, for Management Studio 2005 no such shortcut is available:

Context Menu in 2005:

image 

 

You can set "Copy with Headers" as *default* from SSMS options:

This can be done in both SSMS 2005 and 2008.

1. Go to "Tools" –> "Options"

2. Expand "Query Results" –> "SQL Server" –> "Results to Grid"

3. Check "Include column headers when copying or saving the results"

image

4. Click "OK".

Note: Changes will take effect in new query windows only.

This will enable copying headers with *simple* copy (Ctrl + C).

 

Hope This Helps!

Vishal

If you like this post, do like my Facebook Page -> SqlAndMe
EMail me your questions -> Vishal@SqlAndMe.com
Follow me on Twitter -> @SqlAndMe

About these ads
  1. Doug Jacobsen
    December 9, 2011 at 9:56 pm | #1

    This works too well for me. I’m unable to copy results WITHOUT headers. I have unchecked this option in the settings and select only Copy from the context menu. I still get the headers no matter what process I use (menu, keyboard) to copy and paste. Any thoughts on how to fix this are welcome.

    • December 12, 2011 at 9:45 am | #2

      Hi Doug,

      The only reason I can think of is; When you uncheck this option in settings, the new settings does not take effect in current query window.

      Launch a new query window after changing the setting and try from there.

  2. Ronny
    July 27, 2012 at 9:14 pm | #3

    The problem is with the “Select ” context menu entry on tables. It opens a new result view with the option to copy headers always enabled, even though you disabled it and it is off in new queries opened by yourself.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 146 other followers

%d bloggers like this: