[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Export Store Procedure Results to Excel

Posted on 2004-04-12
2
Medium Priority
?
438 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

649 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