Solved

Export Store Procedure Results to Excel

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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

717 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