SSIS package property "ForceExecutionResult" does not work as expected
I have some problem in SSIS package/task setting .
I have daily schedule task running via Sql server (SSIS Package). In job task contain a few step.
The problem is "SendMail Task" failed sometime. Some time mail server is down. If SendMail task error because server down. All package won't run correctly because package return failure.
This is what I have try to test.
I create a simple package to test in VS2008 In package contain two SendMail tasks. The 1st is a complete task (Config every thing correctly). The 2nd is a failure task (I set wrong receive email address)
In the 2nd task i set property -MaxiMumErrorCount --> From 1 --> 20 -ForceExcutionResult --> From "None" --> "Success"
When I execute package from VS2008 that's look fine. Every thing OK. Package return success result.
But when i create job schedule task in SQL Server job (Agent). And test run package. Package still return failure. I'm so co开发者_如何学Gonfuse for this case. And I don't want to set "ForceExcutionResult" value to be "Success" in package property. I just want package can be running even if Email task has failed. How can i do for solve this problem ?
Thanapat.s
I found a couple of links very helpful and solved it with an on-error event handler (because in my case, I want to send an email if the task fails, but then continue execution without package failure).
So, I created an event handler, and have it force-execution to completion (you could force success) but the key to making it not fail is:
- System variable "Propagate" is set to false in my event handler.
MaximumErrorCount
is set to 0 in the task itself. This was key to not having the package fail.
Kudos to: How to avoid SSIS FTP task from failing when there are no files to download?
The answer links to: http://sqlblog.com/blogs/rushabh_mehta/archive/2008/04/24/gracefully-handing-task-error-in-ssis-package.aspx
Which led me to here: http://agilebi.com/jwelch/2008/06/29/continuing-a-loop-after-an-error/#comment-57484
Which worked!
精彩评论