Execute a Stored Procedure From SSIS
Hi all,
I have an SSIS package that has many steps to update a SQL Server Table from various sources. At the end of these series of updates, I have a stored procedure within SQL Server that updates various fields (using a cursor) (no parameters to pass or
anything, just run it).
How can I add one last step in the SSIS package, to Run that stored procedure?
I am thinking that this should be very simple. Shouldn't it?
Thank you.
Kody_Devl
July 30th, 2012 8:47am
You can add an Execute SQL Task where you execute your stored procedure. The statement will be something like this:
EXEC myProc;
ps: cursors are not very performant for updating tablesMCTS, MCITP - Please mark posts as answered where appropriate.
Free Windows Admin Tool Kit Click here and download it now
July 30th, 2012 8:51am
If you wish to execute that stored procedure for once in a package means..drag Execute SQL Task in to control flow and put your execute stament there and make result set to none..
July 30th, 2012 8:54am
Agreed,
Small table with 365 Loops against 900 records, taking aout 3 secs
Thanks
Kody_Devl
Free Windows Admin Tool Kit Click here and download it now
July 30th, 2012 11:08am
I will give it a try tonight. I hope that it is that simple!
Thanks
Kody_Devl
July 30th, 2012 11:10am
there are two ways to execute : using Execute SQL task as mentioned above, another one with OLEDB Command transformation.
In case you dont need to pass parameter to the sp, you can directly use the EXEC name_of_sp. In case there are parameters present in the sp, you need to handle it little bit separately.
http://geekswithblogs.net/stun/archive/2009/03/05/mapping-stored-procedure-parameters-in-ssis-ole-db-source-editor.aspx
Be aware that using an OLE DB Command transform will execute the sp for every row in the dataflow.MCTS, MCITP - Please mark posts as answered where appropriate.
Free Windows Admin Tool Kit Click here and download it now
July 30th, 2012 12:47pm
there are two ways to execute : using Execute SQL task as mentioned above, another one with OLEDB Command transformation.
In case you dont need to pass parameter to the sp, you can directly use the EXEC name_of_sp. In case there are parameters present in the sp, you need to handle it little bit separately.
http://geekswithblogs.net/stun/archive/2009/03/05/mapping-stored-procedure-parameters-in-ssis-ole-db-source-editor.aspx
regards
joon
July 30th, 2012 1:01pm
there are two ways to execute : using Execute SQL task as mentioned above, another one with OLEDB Command transformation.
In case you dont need to pass parameter to the sp, you can directly use the EXEC name_of_sp. In case there are parameters present in the sp, you need to handle it little bit separately.
http://geekswithblogs.net/stun/archive/2009/03/05/mapping-stored-procedure-parameters-in-ssis-ole-db-source-editor.aspx
Be aware that using an OLE DB Command transform will execute the sp for every row in the dataflow.MCTS, MCITP - Please mark posts as answered where appropriate.
Free Windows Admin Tool Kit Click here and download it now
July 30th, 2012 1:04pm