Search code examples
sql-servereventsssisssis-2012ssis-2008

Does the SSIS Package fail ,when one of the container failed


I have a package with 1 container.Does the ssis pacakge fail,If that container fail!? The property

FAIL PACKAGE ON FAILURE is false for the container.

Does that mean the package fail only if this property set to TRUE,other wise only the container status is failed ,and the package status is not !?


Solution

  • Yes. If the Sequence Container fails, the overall package will fail. Raise the MaximiumAllowedErrors property of the Sequence Container to get the behavior you want.

    Example

    Below we have an example package. The Sequence Container has a task that will never succeed.

    enter image description here

    Above, the Sequence Container has failed and the Package has failed. Below are the properties of the container above. These are the default values for a new container.

    enter image description here

    Now lets stop and study. If we compare the package behavior against the property settings, this looks wrong. Here we have set FailPackageOnFailure=False, yet a Sequence Container failure is causing a Package failure. Why is this? Unintuitive attribute names. See this Microsoft Connect issue. You are not alone in your confusion. The official explanation from Microsoft is this.

    Despite some pretty circular previous messages, we believe that the feature is behaving as designed. When you set FailParentOnFailure to false, the parent will not fail until the number of failures in the child exceeds the MaximumAllowedErrors threshold. When you set FailparentOnFailure to true, the parent will fail on the first occurence of an error regardless of the MaximiumAllowedErrors threshold.

    The important piece of information to take away from that quote is that the FailPackageOnFailure and MaximiumAllowedErrors work as a pair!!!

    So - knowing this - we can achieve the expected behavior by raising the MaximiumAllowedErrors count from 1 to 2.

    enter image description here

    This will allow you to have a sequence container which fails, but does NOT fail the overall package.

    enter image description here

    Hope this helps!