Solved

Export Store Procedure Results to Excel

Posted on 2004-04-12
2
427 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now