Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 3rd, 2006, 03:25 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Norway.
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Default Enterprise Manager vs SQL Management Studio

Hi.

In EM, if you had run a Query, you were able to copy also the Column-headings (and paste them into say Excel).

Does anyone know if this is possible also in SQL Management Studio? And if so, how to do it?

Gert

Reply With Quote
  #2 (permalink)  
Old April 3rd, 2006, 02:54 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

create a new query and select the results to file option

Reply With Quote
  #3 (permalink)  
Old April 18th, 2006, 09:37 AM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Wellington, FL , USA.
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

"Results to File" is best, but you can also select "Results to Text" option and that will allow you to copy and paste the query results, including the column headings.

Reply With Quote
  #4 (permalink)  
Old April 19th, 2006, 03:45 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Norway.
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your replies.

Allthough these are good sugestions, it seems to me that if I want the info into Excel, it doesn't work just as I need it too. In excel all the row data ends up in the first cell. I need the seperate columns to end up in seperate columns also in excel.

Gert

Reply With Quote
  #5 (permalink)  
Old April 25th, 2006, 11:13 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: , AZ, .
Posts: 146
Thanks: 0
Thanked 1 Time in 1 Post
Default

First ensure that Tools, Options, Query Results, SQL Server, Results to Grid, has the check next to Include to column headings when copying or saving the results.

Then run your query in Grid mode, then right click the grid and select Save As, then save it as a csv. Open the CSV in excel and you will have the column headings

David Lundell
Principal Consultant and Trainer
www.mutuallybeneficial.com
Reply With Quote
  #6 (permalink)  
Old April 26th, 2006, 01:47 PM
Authorized User
 
Join Date: Jun 2003
Location: , , Norway.
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks ALOT David. This is just what I was looking for...

It also works with copy/paste into Excel.

:-)

Gert

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant Open SQL Management Studio sahmed1983 BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 1 January 8th, 2007 02:47 PM
Porting SQL Enterprise Manager Tree Settings plusultra SQL Server 2000 1 June 26th, 2006 04:41 AM
Enterprise Manager/SQL Connection Problem wdfadude SQL Server 2000 1 July 14th, 2005 02:22 PM
SQL enterprise manager doesn't see mapped drive Cinderella SQL Server 2000 9 June 20th, 2005 11:49 AM
SQL Server using Enterprise Manager - winproxy whiterainbow SQL Server 2000 0 December 8th, 2004 02:36 AM



All times are GMT -4. The time now is 04:04 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.