MrHat


Hi,

Let's say you have a Data Flow Task that connects to a Foreach Loop, looping through the data.

Somewhere inside the Foreach Loop, you set an int variable MyInt to a value.

My question:

Is it possable when each iteration begins to set MyInt to 0

Thanks in advance.




Re: Foreach Loop - Value back to 0

Phil Brammer


Is the foreach loop evaluating the same variable, or are you using the variable for something else

Script tasks can assign values to variables.






Re: Foreach Loop - Value back to 0

MrHat

Can you set a value of a variable inside an expression




Re: Foreach Loop - Value back to 0

Phil Brammer

MrHat wrote:
Can you set a value of a variable inside an expression


No.





Re: Foreach Loop - Value back to 0

Benorama

But you could set it by running "SELECT = 0" inside an Execute SQL task at the start of your loop, and assigning that output parameter to your variable.