SSIS "for loop" container EvalExpression confusion

  • Hi - This is the first time using this container and it is not behaving like I think it should. I'm missing something.

    I am trying to use it to wait for a job to complete (script task) and then test two counters (record count from input file and output file via sql task loading variable) and exit when they match or when five loops have been performed. It seems to exit only on the when the number of loops exceeded. I read that it continues loop if true and exits when false.

    counter1 is row count from input table

    counter2 is row count from output table

    counter3 is loop count, started at 1

    Tried this: exit when counter 1 = counter 2 or when counter 1 not equal counter 2 and loops > 3

    (@Counter1 != @Counter2 ) || ((@Counter1 == @Counter2) && @Counter3 <= 3)

    I would really appreciate your help on this. It seems so easy.

  • You want this to be false, I think, so that should be your expression:

    [font="Courier New"]@Counter1 != @Counter2 && @Counter3 <= 3[/font]

    John

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

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