Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Nested "For Loop Container" causes the outer loop to end

$
0
0

I have an abstracted project consisting of a "For Loop Container" within another "For Loop Container". The definition of the outer loop is:

and the inner loop is:

The default value for @QuitLoop is False.

Within the inner loop I have a script task which reports the values of the @OuterLoop and @InnerLoop variables and I get 100 messages:

However, if I add a step in the script task which sets the @QuitLoop variable to True at a certain point:

if (iOuterLoop == 2 && iInnerLoop == 4)
{
    Variables vars = null;
    Dts.VariableDispenser.LockForWrite("User::QuitLoop");
    Dts.VariableDispenser.GetVariables(ref vars);
    vars["User::QuitLoop"].Value = true;
    vars.Unlock();
}

both loops stop running at this point:

However the @QuitLoop variable should only impact the inner loop. Why would the inner loop be causing the outer loop to stop early?


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>