How do I copy and paste one record from SSMS 2012 without the header (when it comes along without me asking for it)? In SSMS, Tools -> Options -> Query Results -> SQL Server -> Results to Grid -> "Include column headers when copying or saving the results" is unchecked. Sometimes I would like to copy the header, however most of the time I would like to copy and paste one record into Excel and the header comes along uninvited - either when I do ctrl + C or just right click and "Copy". I've tried rebooting my computer to be sure it wasn't some sort of cached functionality but I can't seem to shake the header. Please help!
Select cells from the columns you want to copy (CTRL+Click), choose "Copy selected Headers" in Results grid context menu and column names will be copied to clipboard.
Using SQL Server Management StudioClick the tab for the table with the columns you want to copy and select those columns. From the Edit menu, click Copy. Click the tab for the table into which you want to copy the columns. Select the column you want to follow the inserted columns and, from the Edit menu, click Paste.
I don't have a root cause. However, a comment on a blog led me to realise that the problem only exists when you right click and go 'Select Top X' or similar. If you go 'new query' and manually enter that query, you can then copy without headers.
I'm still looking for the root cause and a complete solution. Will update my post if I discover anything further.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With