Wednesday, March 28, 2012

Precedence Constraint Expressions

Hi all

I've got a package that checks the length of chars in a flatfile and if it's correct it executes the dataflow task.

How can i write an expression in the precedense constraint editor to skip the dataflow task if there is an error in the script task?

Thank you

Set a variable in the script task and then test the variable in the precedence constraint.|||

Something similar to:

Code Snippet

If [File is Valid condition] Then

Dts.Variables.Item("User::ValidFile").Value = 1

Else

Dts.Variables.Item("User::ValidFile").Value = 0

End If

in the script task (mark the variable as ReadWrite in the script task properties) and

Code Snippet

@.ValidFile==1

in the precedence constraint. You can set the expression by double-clicking the precendence constraint and choosing Expression and Constraint in the Evaluation operation property.

|||

Thanks for all your help Phil and JWelch.

No comments:

Post a Comment