Processing through errors in a ForEach Loop container
I have an SSIS package that uses a ForEach Loop container to process one record at a time, each containing a url address. Within the ForEach Loop container I have a Script Task that uses the url address to connect to a web site. If the Script
Task fails, I divert the url into another SQL table. If the process succeeds I extract XML data from the website into a SQL table. My problem is that when the Script Task fails, it diverts the url address into the SQL table (as desired) , but the error message
pops up and the process stops. How can I configure the package so that it will continue onto the next record?Myles McKee
October 26th, 2011 3:22pm
http://agilebi.com/jwelch/2008/06/29/continuing-a-loop-after-an-error/Manishankar Rajagopal | Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker
Free Windows Admin Tool Kit Click here and download it now
October 26th, 2011 8:10pm
try setting ForceExceutionResult = TRUE for the task
it forces the execution of the package to continue even after the task has failed
October 27th, 2011 4:23am
I applied the solution described in the link above and now the loop runs till it encounters the timeout error, at which point a popup window appears. Once I manually close the popup window the process continues as desired. I tried setting the ForceExecutionResult
to TRUE for both the Script Task and the ForEach Loop task, but it seems to have no effect. Any idea how I can suppress the error popup window?Myles McKee
Free Windows Admin Tool Kit Click here and download it now
October 27th, 2011 10:40am
what is the task from which the pop-up is getting populated ?
what is the value present in the pop-up box ?
if the pop-up is because of the time-out error then i think you have to check the application/website from where you are getting the xml data.
plz let me know if that is the reason.
October 28th, 2011 1:25am
The current error I'm struggling with occurs in the Script Task that extracts the xml data from the web site:
Exception from HRESULT: 0xC0016009
I looked this up online and it appears to be a timeout error. The issue seems to be that it's simply taking too long to pull down the data so the package times out (if I manually enter the url value it works 75% of the time). When I researched it online
all indications are that this is a bug in SQL Server 2005 that could be rectified with SP3. Admin plans to upgrade to SP4 but they're taking a slow, cautious approach. In the mean time I need to have the process running even if it encounters any error.
Thanks.Myles McKee
Free Windows Admin Tool Kit Click here and download it now
October 28th, 2011 9:49am
If you want to go for next iteration even script task fails,
You have to set script task property
Maximum error count is ‘0’
October 31st, 2011 11:24am
Thanks for the suggestion. The problem is that when you set MaximumErrorCount to 0, it no longer passes information from the Script Task to the failing processes. I have two outputs flowing from the Script Task process that pulls down the information
from the url: one for success and the other for failure. When the process fails I'd like to capture information and move onto the next record without having to acknowledge the error. Is that possible?Myles McKee
Free Windows Admin Tool Kit Click here and download it now
October 31st, 2011 1:17pm
Set foreach loop container property “maximum error count is 0”.
Script task property “maximum error count is 1”
Take two tasks (according to requirement) one is for script task success other one is for failure.
While the time of execution according to the script task, failure and success corresponding task will fire (success and failure).
If you want to send a mail about failed URL,
Set precedence constraint is “failure” for send mail task ( from script task to send mail task) and writes expressions for send mail task to assign the for each loop container output variable to send mail task.
If any failure happens the send mail task will trigger.
November 1st, 2011 8:28am
Set foreach loop container property “maximum error count is 0”.
Script task property “maximum error count is 1”
Take two tasks (according to requirement) one is for script task success other one is for failure.
While the time of execution according to the script task, failure and success corresponding task will fire (success and failure).
If you want to send a mail about failed URL,
Set precedence constraint is “failure” for send mail task ( from script task to send mail task) and writes expressions for send mail task to assign the for each loop container output variable to send mail task.
If any failure happens the send mail task will trigger.
Free Windows Admin Tool Kit Click here and download it now
November 1st, 2011 3:26pm
Check the source code in the script task. You could use try{ } catch{ } block to suppress the exception.
November 2nd, 2011 8:01am
I was never able to resolve the issue with the pop-up window stopping my SSIS process in it's tracks. I was using SQL Server 2005 that hadn't received the last two SP updates (and it didn't look like it was going to happen anytime soon). The solution I reached
was to use a Production server with SQL Server 2008 installed, which allowed me to adjust the timeout error setting.
Thanks to everyone for their helpMyles McKee
Free Windows Admin Tool Kit Click here and download it now
December 12th, 2011 11:45am