Reputation: 14148
I would like to execute a stored procedure MyProc
with certain input parameters for each row in the table MyTable
. Column for each row will act like input values for MyProc
.
How do I accomplish this in SSIS? I have been told by upper management to use SSIS and I don't have any choice in this matter.
So.. I have done the following:
It looks like the DataFlowTask in step 3.1 is being called for all rows in step 2.1
What I want is to invoke DataFlowTask in step 3.1 to get called for each record in the row in step 2.1 AS OPPOSED TO all the records.
Once this works, then I intend to ExecuteSQLTask
inside a ForEachLoopContainer
.
Upvotes: 3
Views: 8098
Reputation: 31785
All you need is a Dataflow Task with an OLEDB source and an OLE DB Command transformation.
The OLEDB source SELECTs from the table that you want to perform the row-by-row stored procedure on.
It then is followed by an OLE DB Command transformation that calls the stored procedure and passes columns from the data flow to the parameters of the stored procedure.
This will result in the stored procedure being executed once for each row of your table. You don't need the initial Execute SQL, and you don't need the For-Each loop.
Upvotes: 8