ForEach Loop Not updating Folder value from Package Config Variable

  • I have an SQL 2008 SSIS package that uses a config file to update package variables before executing. The variables are changed, but the ForEach Loop does not pick up the changed variable. The Foreach Loop Collection uses a Foreach File Enumerator and has a mapping to a package variable [User::sFileName]. Hard coding the Folder correctly iterates through the files. How can I force the ForEach loop to use the package variable? Is there an object reference to the Foreach Loop that I can script an assignment before calling the Foreach Loop? Thanks.

  • Double-check the scope of your variable, making sure there is not a variable with the same name scoped at the package level and the Foreach Loop container level.

  • I only have a global scoped package variable. I'm referencing this variable in the Variable Mappings to replace the folder (which changes daily) in the Enumeration configuration. This is the folder I need to replace daily: \\srvr2mcrsapp1\cashiertotals$\Archives\04-08-2010\ and it works if I change the folder's day name "04-08-2010", for example. I've tried these three variables:

    sFileName: \\srvr2mcrsapp1\cashiertotals$\Archives\04-08-2010\cshr_ttls.1.csv

    sFolder: 04-08-2010

    sPath: \\srvr2mcrsapp1\cashiertotals$\Archives\04-08-2010\

    Any ideas will be welcome. Thanks.

    Dan

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

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