SQL Server 2005: Include Column Headers When Copying Grid Query Results

Contributor Icon Contributed by Rob Rogers  
Tag Icon Tagged: Database  

Previous versions of SQL Server have featured the ability to create grid result sets from queries so that one can easily copy and paste the data into another application. Unfortunately, the column headers were not copied, so you then would have to go into the application and add the header by hand. SQL Server 2005 provides a new option that will allow you to copy the column headers with the data. Here is how to activate this handy option…


1. Open SQL Server 2005 Management Studio.

2. Click Query and select Query Options.

3. In the Query Options dialog box, expand the Results setting in the left pane.

4. Click Grid.

5. Check the Include column headers when copying or saving the results checkbox.

6. Click OK.

Now when you copy your query results, the column headers will be copied along with the data.

 

7 Comments -


  1. Raymond said on October 29, 2008

    That is great but I’m sure that it was default behaiviour somewhere in 2000. Can’t remember if it was the enterprise mangler or query studio though.

    What I’d really like is some way to keep that checkbox ticked instead of having to click it ten times a day.

    R.

  2. Punit said on August 19, 2009

    thanks. this saved me lots of time and frustration!

  3. anoop said on November 12, 2009

    thanks from me also it is of great help.

  4. Shishir Shirke said on May 28, 2010

    Thanks Shamanstears….. it was helpful for me.

  5. Ahmad I Elkhatib said on February 16, 2011

    Great, Thanks, THIS IS SO HELFUL,
    Regards

  6. sergy said on September 2, 2011

    Thanks! How to make this permanent (default)?

  7. hector said on January 10, 2012

    thanks, this es so helful :D aaammmmuuuaaa

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -