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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

export the result of the query and the fields name 2

Status
Not open for further replies.

codrutza

Technical User
Mar 31, 2002
357
IE
SQL Server Management Studio Express

Please help me with this:
How to export the result of the query and the fields name? I try with csv and exports only the content.

 

Run the query

Right Click just above row 1 in the top left corner of the results grid.

Select "Select All"
Select "Copy with Headers"

Paste the results into Excel with the Column Headrs in place.



I love deadlines. I like the whooshing sound they make as they fly by
Douglas Adams
(1952-2001)
 
Thanks. I don't see "Copy with Headers".
 
Or (assuming grid for results):
Run the query

Left Click just above row 1 in the top left corner of the results grid to highlight all result "cells".

Right Click in the same place and select "Copy"

Paste the results into Excel with the Column Headers in place.

(Note that Excel helpfully converts strings like '0001' into 1, so you may need to format the destination page accordingly before pasting or change and then re-paste.)


soi là, soi carré
 
Sorry, I still can't "Paste the results into Excel with the Column Headers in place". Where is "Column Headers"? I don't see it at all. I don't know. Maybe because I have an older version?

 
In SSMS:

Click Query
Click "Query Options"
Expand "Results"
Click on "Grid"
Select "Include column headers when copying or saving results"


-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
It may just not be a feature of the Express version of the Management Studio.

If you need advanced features, would it hurt you much to spend about 50 USD? That's about the price of SQL Server Developer Edition, and it's the full blown Enterprise version, just with the restriction being for development only.


2012 Developer Edition should be available soon.

Even if you use the Express or Local version for your users, you can use the full blown SSMS for your easier development. It pays quite well.

Besides with an Action Pack (Development and Design) as a developer or ISV you can get even more for about 300 USD.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top