Controling the number of iterations in a ssis foreach loop

  • I'm trying to control the number of iterations within a Foreeach loop. I'm trying to obtain files from a folder and I only want to pull 10 files at a time. How do I control the number of iterations in a foreach loop?

    Thanks in advance!

  • With Foreach File Enumerator, i believe we cant control untill and unless you define a file format say append a string to each file name which has a finite number of iteration and so.

    my suggestion is use Script Task instead.

  • My approach would be to use a for each loop with a script and the other desired workflow process.... i would loop through all the files and use a script to get the count and then use a precedence constraint after the script and process only first 10 files

    so you will need to write a script to count the files and use another variable(@var) to hold the count which can be later used in the precedence constraint..... @var<=10 .. that way you can process your first 10 files

  • Thanks! From everything I have seen, that's about the only way!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply