Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Sequence container not to fail if a task fails inside it


Sequence container not to fail if a task fails inside it

Author
Message
robinrai3
robinrai3
Valued Member
Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)

Group: General Forum Members
Points: 71 Visits: 348
hi All,

Just need a steer...in that i have a sequence container with 3 tasks
i need to go down the failure route if all 3 fail but down the success
route if at least one of them succeeds. What would be the de facto way
of programming this.

NOTE : On the failure i do not want the sequence container task to fail.
only to go down the failure route...
Andy Leonard
Andy Leonard
Mr or Mrs. 500
Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)

Group: General Forum Members
Points: 507 Visits: 1092
Hi Robin,

If you set the MaximumErrorCount property on the Container to 3, that should do it. It defaults to 1 and so fails on the first error. You have three tasks inside, so a MaximumErrorCount of 3 should cause the Sequence Container to fail while 2 or less will allow it to succeed.

Also, if you're using Precedence Constraints to connect the tasks inside the Container and using the Constraint Evaluation option, be sure to change them to Completion.

You have to have the Sequence Container fail to utilize a Failure Precedence Constraint. But, as with the tasks inside the Sequence Container, this doesn't have to stop execution. The package also has a MaximumErrorCount property accessible from the Control Flow itself. You can set it to some number higher than the default (1) to have allow execution to continue after an error. Remember the part about using Completion Precedence Constraints earlier though.

As Julie Smith taught me, you set the MaximumErrorCount property to 0 to ignore all errors at the package level. this won't work for the Sequence Container because you want to trigger a Failure Precendence Constraint on the third error, and the only way to do that is to have the container fail on error #3.

Hope this helps,
Andy

Andy Leonard
Data Philosopher, Enterprise Data & Analytics
robinrai3
robinrai3
Valued Member
Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)

Group: General Forum Members
Points: 71 Visits: 348
thanks Andy...I'll give it a go
syed_jafri786
syed_jafri786
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 149
Hi Andy,

I have opposite problem. I have sequence containter in which I have two script. I want the container to get fail when one task fail but it is not happening. Andy, any help will be highly appreciated.

Thanks,

Syed
Andy Leonard
Andy Leonard
Mr or Mrs. 500
Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)Mr or Mrs. 500 (507 reputation)

Group: General Forum Members
Points: 507 Visits: 1092
Hi Syed,

The scenario you describe is the default behavior. Make sure the MaximumErrorCount property of the Sequence Container is set to 1 (the default), the ForceExecutionResult property is set to None (the default), and the ForceExecutionValue property is set to False (the default).

Hope this helps,
Andy

Andy Leonard
Data Philosopher, Enterprise Data & Analytics
syed_jafri786
syed_jafri786
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 149
Thanks Andy for your reply. However, I have all those condition set what you have metioned but it is still failing. Does it matter if the two script task running parallel in the sequence container which is condition in my package. There are two script task running in the parallel in sequence container. Any help will be highly appreciated.
Abu Dina
Abu Dina
Right there with Babe
Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)

Group: General Forum Members
Points: 723 Visits: 3323
Long shot but if I've understood this correctly, you don't want error in your tasks to bubble up to the sequence container?

If that's the case then why not add an onError even handler and then from the variables window set the system variable Propagate to false. You can create a variable for error count and increment that by one for each task. At the end if the count is three then you go down one route if less than 3 you go down the other?

Hope that makes sense?

---------------------------------------------------------


It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens

Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
syed_jafri786
syed_jafri786
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 149
Thanks Andy for your quick reply. That make sense, let me try it and will let you know the result.
syed_jafri786
syed_jafri786
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 149
Thanks Andy for your quick reply. That make sense, let me try it and will let you know the result.
Abu Dina
Abu Dina
Right there with Babe
Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)Right there with Babe (723 reputation)

Group: General Forum Members
Points: 723 Visits: 3323
Is this what you're after?!







---------------------------------------------------------


It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens

Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search