Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSIS How to ForceExecutionResult Success for the Grandparent Container

Your help and insight is greatly appreciated

In SSIS I need to ForceExecutionResult = Success for the Grandparent Container

This is how I have my package set up currently:
Parent Package = A
Child Package = B

- An Execute Package Task calls B from A
- If B fails with a specific error code, I retry B

I retry B by way of the OnError event handler in A's Execute Package Task using a Script Task.

To my way of thinking:
- A's Execute Package Task OnError event handler is the Script Task's Parent Container
- A's Execute Package Task is the Script Task's Grandparent Container

How do I ForceExecutionResult = Success for the Grandparent Container (A's Execute Package Task) when the B retry succeeds?

Right now even when the B retry succeeds, A's Execute Package Task still shows Red = failure as a result of the failure that happens on the first B attempt.

Looking for a programmatic way of doing this with C# or VB inside a script task.

I am using SSIS 2008

Thanks for reading

like image 567
Jon Jaussi Avatar asked Nov 12 '22 19:11

Jon Jaussi


1 Answers

Main advise is not to rerun package B after OnError event. You need to call B, make sure it does not fail package A, evalute outcome of package B and decide what to do.

  1. Create a For Loop container and make it run for a set number of times (= max numbers of runs, like in while i < 5 do).

  2. Set Execute Package task not to fail parent and whole package on error.

  3. Evaluate execution code in a Script Task and exit For Loop container on success / failure condition. (like by setting i=5).

Probably you can execute package B from C# Script Task - check object model how to do that. I'll update my answer if I find how to.

like image 121
Stoleg Avatar answered Nov 15 '22 07:11

Stoleg