I’ve two nested foreach loop containers. Each are looping on different resultsets. I’ve a script task, within the inner foreach loop container, in which I need to be able to acccess values of current row of both the loops. One way of doing it is using variable mappings on both the loops, but is there a way to access current row from within the script? any ideas?
I’ve two nested foreach loop containers. Each are looping on different resultsets. I’ve a
Share
You can access variables mapped in loop containers in script task via
Variablesproperty of theDtsobject if you add this variables toReadOnlyVariablesorReadWriteVariableslists in the Script Task Editor.Map current row of each loop to variable and then access this variables in script task. Isn’t this enough?
Example:
You can read more here: http://msdn.microsoft.com/en-us/library/ms135941.aspx
Update:
You can map whole row to variable at once. Use
Objectas variable type and set Index =-1in Variable mappings in Foreach loop.You should receive enumerator, which type is related to enumerated collection.