?
Solved

Export Store Procedure Results to Excel

Posted on 2004-04-12
2
Medium Priority
?
437 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Assisted Solution

by:danblake
danblake earned 750 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 750 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

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
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.
Suggested Courses

801 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