• A foreach loop in SSIS is, by definition, an iteration of n items, in which n is defined at the beginning of the loop. So you can't really exit a foreach loop prematurely. However, you could configure your package to effectively do nothing in a loop.

    I blogged about the scenario you describe here some time back: http://www.timmitchell.net/post/2009/09/16/skipping-items-in-a-foreach-loop/. Essentially, you can use an SSIS expression on your precedence constraint to check some condition before executing anything else in that iteration of the loop. You could interrogate your date table that you mentioned in each loop and see if the current date has already been loaded. You wouldn't be terminating the loop early - the loop would still execute once for each file in the target directory. However, binding an expression to that precedence constraint would allow you to conditionally skip files representing dates that have already been processed.

    Hope this helps!

    Tim Mitchell, Microsoft Data Platform MVP
    Data Warehouse and ETL Consultant
    TimMitchell.net | @Tim_Mitchell | Tyleris.com
    ETL Best Practices