September 16, 2008 at 10:51 pm
How to save the stored procedure output(resultset) to excel file with resultset is properly displayed with its columns and also with proper formatting?
My stored procedure executes inside the job created using SQL server Agent. In job if I set the output file as excel/csv file, than the data is not displayed in proper format.
I also tried using BCP utility with excel file as output file, here also the formatting is not proper.
I need a solution where the resulset is properly displayed in excel file with proper columns.
September 17, 2008 at 8:25 am
You could use SSIS to do this. You would want to do a Data Flow Task where your source query is the SP and your destination is the Excel file. Then you can schedule the Package in SQL Server Agent.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
September 19, 2008 at 6:27 am
What kind of FORMATTING oyu are talking about ....is it like width of excel's column ??
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
September 21, 2008 at 10:10 pm
Formatting here means resultset to be displayed in proper columns in excel sheet.
September 21, 2008 at 10:59 pm
INSERT INTO OPENROWSET ('MICROSOFT.JET.OLEDB.4.0', 'Excel 8.0; Database=D:\RFPSent\SENT_RFPs.xls;HDR=NO;IMEX=2', 'select * from [Venue_RFPs$]'
) SELECT * from tblvenue_RFP
------------------------------------------
In above text [Venue_RFPs$] is a worsheet which has same column as table tblvenue_RFP
is you follow same sequence for both WORHSHEET and TABLE ..the data will be correctly migrated
i hope you will get your solution 🙂
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
September 26, 2008 at 6:27 am
U can write a simple .NET windows application and call urs stored procedure and send the result set to excel
This is very simple.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply