Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Determine which precedence constraint executed script task Expand / Collapse
Author
Message
Posted Tuesday, December 17, 2013 9:18 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Monday, June 16, 2014 11:58 AM
Points: 496, Visits: 816
Is it possible to check what type of precedence constraint actually executed the Script Task from within the script? I'd like to change a user variable based on whether the constraint was an error or a success.

I'm accomplishing what I need too already by segregating error and success paths to their own Script task. Was hoping I could do it with one Script task instead though.
Post #1523761
Posted Tuesday, December 17, 2013 9:29 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, October 9, 2014 1:02 PM
Points: 6,032, Visits: 5,284
I don't think I have ever seen anything that allows you to determine that..

CEWII
Post #1523771
Posted Tuesday, December 17, 2013 9:36 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, September 18, 2014 1:52 PM
Points: 504, Visits: 1,870
AVB (12/17/2013)
Is it possible to check what type of precedence constraint actually executed the Script Task from within the script? I'd like to change a user variable based on whether the constraint was an error or a success.

I'm accomplishing what I need too already by segregating error and success paths to their own Script task. Was hoping I could do it with one Script task instead though.


Haven't seen anything like this before but I'm wondering if something like this might work. For the task prior to the script, place a value in a variable if the OnError event fires. Then use a completion constraint to go to the script task. Execute your script code based on whether the error variable contains the set value from the OnError event (Failure) or the default value you defined for the variable (Success).

[Edit: Clarified the Failure and Success]
Post #1523775
Posted Tuesday, December 17, 2013 10:44 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Monday, June 16, 2014 11:58 AM
Points: 496, Visits: 816
kl25,

I kind of started to explore that option after you mentioned it. I'm not really familiar with event handling so it'd be good for me to goof around with it.
Post #1523814
Posted Tuesday, December 17, 2013 10:47 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, September 18, 2014 1:52 PM
Points: 504, Visits: 1,870
I've used it for other purposes to populate error related variables. Has been a helpful method to capture error information in variables.
Post #1523816
Posted Tuesday, December 17, 2013 11:10 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Monday, June 16, 2014 11:58 AM
Points: 496, Visits: 816
Yeah that's the next step in this package. Capturing the errors. Chapter 17: Error and event handling. :D
Post #1523827
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse