Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL 2005 Query Analyzer - Copying over column names to MS Excel

Status
Not open for further replies.

charliescott

IS-IT--Management
Joined
Aug 10, 2005
Messages
7
Location
US
A huge frustration of mine is copying data from the GridView in SQL Server 2000 Query Analyzer to MS Excel and the fact that the column headers do not seem to come across.

I heard a while back that this issue had been resolved in SQL 2005. I just checked this out and much to my dismay, this does not appear to be the case. Is there a setting in SQL 2005 to turn this feature on?

thanks.
 
SQL 2005

Goto Tools, Options, Query Results, SQL Server, Results to Text

change output format to Tab delimiter

run query save results as filename.csv

SQL 2000

Goto Tools, Options, Results

change default results output format to comma delimiter

run query save results as filename.csv
 
Another option, in Excel 97 anyway, is to open a spreadsheet, click data, get external data, run data base query. It will punch the output into the spreadsheet with column headers.

You will probably need to make the connection the first time and save it for later use. Once you have it set up it's easy to use over and over again.
 
Thanks guys for your above response. Both are very good suggestions, however, I was looking for a way in which to transfer results (including column headers) of select statements / temp tables via copy/paste out of the grid view and into ms excel for some quick and dirty analysis.

Again, both of your suggestions would function perfectly, however, I don't believe that they beat the simplicity of the copy & paste functionality. It appears though that microsoft has failed to build this functionality into sql 2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top