Copy and paste headerless SSMS

How to copy and paste a single entry from SSMS 2012 without a header (when it happens without my request)? In SSMS, tools → Options → Query Results → SQL Server → Results for the grid → “Include column headers when copying or saving results” will be disabled. Sometimes I would like to copy the header, but most of the time I would like to copy and paste a single record in Excel, and the header will appear uninvited - either when I do ctrl + C, or simply by right-clicking and “Copy”. I tried to restart my computer to make sure that this is not some kind of cached functionality, but I can’t shake the header. Please, help!

+9
copy-paste header ssms
source share
6 answers

I have no root cause. However, the blog comment made me realize that the problem only exists when you right-click and select “Select Top X” or the like. If you send a “new request” and manually enter this request, you can copy it without headers.

I am still looking for a root cause and a complete solution. My post will be updated if I open anything else.

+6
source share

I think he is looking at the wrong setting value.

I unchecked "Tools" → "Options" → "Query Results" → "SQL Server" → "Results in Text" → "Include Column Headers in the Result Set"

A new query window opened, and the functionality worked as expected, that is, Ctrl-C only copied the contents of the Grid cell, including the headers in Shift-Ctrl-C.

+5
source share

If you select records in grid editing mode, the headers will not be copied to CTRL + C and CTRL + V action

+2
source share

If the parameter you described is not set, then Ctrl-C should copy the data without headers. Just confirmed it.

+1
source share

If you have already unchecked “Include column headers in the result set” through Tools → Options → Query results → SQL Server → Results in text → “Include column headers in the result set”, and you still have problems.

  1. Copy your entire request
  2. Open a new query window
  3. Insert request
  4. Run request
  5. Ctrl + C or right click, copy.

This worked for me when working with Excel.

0
source share

To save someone else 15 minutes of frustration by exploring this:

I just experienced this problem that persisted after unchecking Tools -> Options -> Query Results -> SQL Server -> Results to Grid -> "Include column headers when copying or saving the results

I had to restart SSMS for the changes to take effect.

-one
source share

All Articles