I have a package that has a foreach file enumerator. Now I have a variable called EmailTo
which is populated by an execute sql task outside the foreach container placed just before the loop container since i only need to run the execute sql task once. The variable EmailTo
is being accessed by an send mail task inside the foreach container. When i inspect the breakpoint. I learned that the value of EmailTo variable is null inside the foreach container. Why is that?
Currently, I moved the execute sql task inside the foreach container to make it work because I have to present it to my boss but there is no point of moving the execute sql task inside the loop since i only have to fetch the email once.
What should I do.