Copy with Headers

Rate This
  • Comments 1

When you run a query in SQL Server Management Studio (SSMS), by default the results are sent to a grid. You can select the rows in this grid by clicking and dragging on the rows themselves and copy them to the clipboard with CTRL-C or using a right-click menu item. But there are a couple of other tricks in the grid area.

Just like Excel, you can click in the leftmost-top cell to select all cells. You can also hold the CTRL key down and click individual cells - in that way you can select a "ragged" set of data.

In previous versions, when you copied the results you got the data but not the headers for them. In SQL Server 2008, we've added a right-click menu item - "Copy with Headers" (this even works with ragged selections). Now when you paste the data in an e-mail or in Excel, you'll actually know what the data represents!

Leave a Comment
  • Please add 5 and 8 and type the answer here:
  • Post