How to redirect 'Execute SQL Task' Output

  • Hi,

    I am using an 'Execute SQL Task' Step to return a COUNT as the result. Now if this Count value = 3 I want to direct the output to another 'Execute SQL Task' or else send an error message. I have designed the 1st 'Execute SQL Task' to get the Count and I also store it in a variable 'User::Count' in the Resultset. But I am lost as to where do I check if this value is 3 or not. Once I can do that check I can redirect it to the next step. The flow would look something like the following:

    If Count <> 3

    Execute SQL Step 1 ----------------> Send Error Mail and Exit

    |

    | If Count = 3

    V

    Execute SQL Step 2

    Can somebody please help?

    Thanks,

    SJ

  • You can have 2 precedent constraints and have them check the value of the Count variable. On the precedence constraints (green arrows for success) you'd change the options to:

    For the "failure" option:

    Evaluation Operation: Expression and Constraint

    Value: Success

    Expression: @Count 3

    Multiple Constraints: Logical And

    For the "success" option:

    Evaluation Operation: Expression and Constraint

    Value: Success

    Expression: @Count = 3

    Multiple Constraints: Logical And

  • Thanks Jack! That worked.

    ~SJ

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply