Solved

Export Store Procedure Results to Excel

Posted on 2004-04-12
2
434 Views
Last Modified: 2012-08-13
Hi,

I am trying to export the results of a store procedure to an excel file.

The store procedure is made up of about 30 select statements that return mostly count or sum values e.g.

select count(blah) from table_blah where blah = 'blah blah'

I am a novice at DTS and it only passes the first result from the first select statement - how do I get all the results?

Cheers - and thanks for solving this headache!
0
Comment
Question by:farawayman
2 Comments
 
LVL 13

Assisted Solution

by:danblake
danblake earned 250 total points
ID: 10804325
A stored procedure normally only returns the first sql select statement out of the system, they are not designed to send out 30 different select statements as a suitable output to DTS or any other part of the system.

Why not post the SP, and we may be able to optimise this for DTS or put all the SP's (select code) within the DTS packages to generate the output as required.
0
 
LVL 3

Accepted Solution

by:
jayrod earned 250 total points
ID: 10805433
try using an inline sql  function. it will return a table instead of a row set.. however you may also want to look into using views and multi statment procedures in the same manner.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question