danburyit
asked on
Best ways to cancel package execution
I have a package that is using a Script Task to set a package variable. If the variable doesn't get a valid value (a date) is there a command to cancel the package execution?
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Of course! I forgot about that. Thank you!
ASKER
Setting the following property in the script code can determine if the precedent constraint (outlined above) will succeed or fail.
If (My code does what I want it to) Then
Dts.Results.Success
Else
Dts.Results.Failure
End If
If it's "Failure" then the precedent constraint will stop the package execution. Only in this case you don't need to evaluate anything in the precedent constraint. Just leave it with default value.
ConstraintDefault.png
If (My code does what I want it to) Then
Dts.Results.Success
Else
Dts.Results.Failure
End If
If it's "Failure" then the precedent constraint will stop the package execution. Only in this case you don't need to evaluate anything in the precedent constraint. Just leave it with default value.
ConstraintDefault.png
Example:
Dts.Events.FireError(-1, "", "SSIS - @LastRunDate_Dados>@StartD
Helped?
regards