Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Export procedure results to excel dynamically

Author  Topic 

scottcabral79
Starting Member

3 Posts

Posted - 2007-05-16 : 07:59:29
Hi,

I am trying to create a DTS package that uses a sql stored procedure to generate a set of results and export those results to an excel spreadsheet on a server.

The trick is that the stored procedure accepts a parameter for Bank_Number (there are 10 of them). Therefore i was wondering if there was a way to somehow create the package to run the stored proc 10 times, each with a different bank number as the parameter and generate 10 different excel spreadsheets, one for each bank with it's results.

Can this be done using DTS or do i have to try another method?

thanks
scott

nr
SQLTeam MVY

12543 Posts

Posted - 2007-05-16 : 10:51:20
Can't you just loop round the transform data task, have global variables for the SP call and spreadsheet name- in the loop have a task to set the global variables then dynamic properties task that sets the SP call and spreadsheet name from those variables.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -