SSIS result set fed in parallel to stored procedure
I currently have 2 stored procedures ...
Stored Proc #1 returns a list of products based on a range of criteria
Stored Proc #2 accepts a single productID and performs some complex query logic and writes the results to a table
My problem is that there are over 30,000 products and going through the result set from stored proc #1 one at a time is too slow and I can't easily integrate an entire batch call into stored procedure #2
My question is as follows: Using SSIS is there a way to setup a task that would take the result set from Stored Procedure #1 and call Stored Procedure #2 开发者_运维百科in parallel with each row.
EXAMPLE of Stored Proc 1 result set
-----------------------------------
Product ID
----------
ABC123
XYZ987
AAABBB
CCCDDD
EEEFFF
I need to setup SSIS to call the following in parallel:
-------------------------------------------------------
EXEC StoredProc2 'ABC123'
EXEC StoredProc2 'XYZ987'
EXEC StoredProc2 'AAABBB'
EXEC StoredProc2 'CCCDDD'
EXEC StoredProc2 'EEEFFF'
Ouch, that's many executions of SP #2. You can do it though.
Create a data flow task. Add an OLE DB Source component to the data flow. Edit the component and configure it to execute SP #1. You can view the columns in the editor to see what will be output from the component.
Add an OLE DB Command data flow transformation component. Create a link from the first component to the OLE DB Command component. Edit the component and enter the SQL statement that will run SP #2 in the SqlCommand property on the Component Properties tab. Include question marks (?) for each parameter for the SP.
Select the Column Mappings tab. Associate an Input Column with each parameter.
精彩评论