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);