Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Failing a package based on DB2 stored procedure returnCode value

$
0
0

In my SSIS, I am reading data from a source database and then processing row by row to send updates to AS400 by calling AS400 (DB2) stored procedure.  Stored procedure has an output parameter @Returncode and I want to use it and see if stored proc returned success or failure. I want to stop processing rest of the data  when stored proc returned failure and fail the package.

I added a conditional split after stored procedure call and have a script component when stored proc call failed. I am raising error in the script component using following code, error is raised but package continues to process the data -

bool pbCancel = false;

        ComponentMetaData.FireError(0, "iSeries Error", "Failed in iSeries stored proc call - Return Code:" + Variables.AS400ReturnCode, "", 0, out pbCancel);


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>