Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««678910

The Best Kept Secret About SQL Query Analyzer Expand / Collapse
Author
Message
Posted Tuesday, November 13, 2007 8:08 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, July 11, 2013 7:37 AM
Points: 25, Visits: 107
There is an easier answer (perhaps the capability was added in a later Service Pack)

In Management Studio select Tools Options/Query Results/SQL Server/Results to Grid and check the Include Columns Headers when copying or saving results. These settings apply when you open a new QA tab.

To select the whole results set click on the top left corner for the grid (above the row number and left of the column headings) right click and copy to the clipboard. Paste into a cell in Ecxel and you will get the headers.

Robin
Post #421610
Posted Tuesday, November 13, 2007 8:17 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, May 14, 2008 3:43 AM
Points: 37, Visits: 12
Robin,

This may work in Management Studio (SQL 2005) but this features is not available in SQL Query Analyzer (from SQL 2000).

The clue's in the title of this thread! ;)

Adam
Post #421614
Posted Tuesday, November 13, 2007 8:30 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, July 11, 2013 7:37 AM
Points: 25, Visits: 107
LOL, thanks for pointing that out. I still think of the Query tab as the Query Analyzer. My search was for 2005 and I did not look at the tags for the thread.
Robin
Post #421626
Posted Wednesday, December 12, 2007 7:51 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, April 15, 2008 8:50 PM
Points: 1, Visits: 5
Very Helpful!!!! I switch between the Results Output Format often and have grown tired of clicking my way through the process.

Now If only there was a way to toggle between the different Results Output Format without going through the Options window, similar to CTRL+T, CTRL+D,CTRL+F for the results target format....Is there?

If you know how, please share.
Post #432313
Posted Thursday, October 15, 2009 5:32 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, October 15, 2009 5:16 PM
Points: 2, Visits: 0
If anyone is interested, I've created an SSMS 2005/2008 Addin that allows saving SQL query results as an XLS file, with header and value formats intact. You don't have to mess around with copying and pasting to import CSV.

http://www.SsmsXlsExport.com/

Cheers,
David
SsmsXlsExport.com

Post #803890
« Prev Topic | Next Topic »

Add to briefcase «««678910

Permissions Expand / Collapse