1
votes

I am new to SSIS and am building a package to perform varies File System Tasks. All objects are working as intended with the exception of a group of Foreach Loop Containers that are within a single Sequence Container. The idea is that I want them to run simultaneously, but don't want the package to go to the next step until all have run.

These Foreach loops check for a specific wildcard within the file name and move it to another folder, renaming the file as well. When I execute each Foreach Loop manually (right click the container and hit Execute Container) the task is performed correctly confirmed by a green check mark on both the Container and the File System Task and I see the file was moved properly to the destination folder.

enter image description here

But when I try to execute the entire Sequence Container, only one file system task is completed successfully (seemingly random as it's different each time I try). Despite receiving all check marks, only one file was actually moved and renamed.

enter image description here

I also tried adding constraints to flow from one container to the next. This time the green check mark appears on all 5 containers but only the first File System Task is checked off (and was moved + renamed). It's as if the rest of tasks were skipped.

enter image description here

How can I ensure that all tasks are completed each time I run the package?

EDIT: Here are the execution results of my last run:

enter image description here

1
Do the 5 different loops/tasks share a common variable or connection in any of their expressions?Tab Alleman
They are all using the same source folder variable, but no direct connections. They have their own destination variables.Matt
Is the value of that shared variable expected to be different for each loop, or do they all in fact use the same source folder?Tab Alleman
They pull files from the same folder (files we receive from a FTP site). I'm moving each category to their own destination.Matt
In the ForeachFile Enumerator, you need unique filters for the "Files"..do you have those unique for each of those loops?DIWP

1 Answers

0
votes

The only way for For-Each loop to not execute is if the enumerator is empty. There is something happening after the first randomly selected FE loop that ensures that the rest of the F-Each loops have no enumerations. I would do the following:

  • Put a variable value changed break-point on the variables used for source folder, and for each file that's being moved. I'd go to the length of putting a script task with a message box that shows the file path. Put these breakpoints on each loop.
  • Ensure that your file path is fully qualified so that source used is indeed correct
  • Check progress tab for details FE loop