In SQL 2012 I have an SSIS package with a For Loop Container. In the SSIS Package I have a variable @LoopCount as an Int16. Within the Container I check some logic and if true run the following in a C# Script Task:
int LoopCount = (int)Dts.Variables["User::LoopCount"].Value;
Dts.Variables["User::LoopCount"].Value = LoopCount + 1;
And for the Loop container I have this:
InitExpression: @[User::LoopCount] = 0
EvalExpression: @[User::LoopCount] > 0
But when I run the package the loop never loops, just a green check with nothing within it executing. Even if my internal logic is screwy I'd think this would at least do an infinite loop, but it doesn't run even once.
Thanks for any advice.