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

Sql Query output in excel format Expand / Collapse
Author
Message
Posted Tuesday, October 05, 2010 4:00 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, March 13, 2012 3:58 AM
Points: 42, Visits: 234
Hi,

I have some doubt about , how to save the query output in excel file.
suppose when i fire this query from query window.

select 1 as 'd','pankaj' as 'name'

then the result will be saved in excel file .

is it possible , how can i do it.
Post #998191
Posted Tuesday, October 05, 2010 6:26 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, May 02, 2013 1:20 PM
Points: 1,235, Visits: 5,389
You can save a grid as CSV or you can select the entire grid and paste it into Excel. There is a setting in options that will copy the field names as well.

Drew


J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
Post #998272
Posted Tuesday, October 05, 2010 8:16 AM


Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, February 07, 2011 9:26 AM
Points: 17, Visits: 106
You could also use SSIS to export the data by query to an Excel file. Just right-click on the database and select "Tasks" then "Export Data...". That will bring up a Wizard you can walk through and push your result set to an Excel file.

Not as quick as the copy/paste method though!
Post #998384
Posted Tuesday, October 05, 2010 1:16 PM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, December 26, 2012 11:03 PM
Points: 586, Visits: 2,195
pankaj.kuchaliya (10/5/2010)
Hi,

I have some doubt about , how to save the query output in excel file.
suppose when i fire this query from query window.

select 1 as 'd','pankaj' as 'name'

then the result will be saved in excel file .

is it possible , how can i do it.


Hi
In grid there will be results to text,results to grid,results to file use have to choose results to file in this case to store what ever format u need, then execute it and save it in your desired name.

Thanks
Parthi


Thanks
Parthi
Post #998709
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse