Moving multiple files using File System Task in SSIS

  • Hello All,

    I have a ForEachLoop container with a DFT that imports data from multiple files into a single table. I want to have a File System Task with in same ForEachLoop Container to move the files to an archive directory immedietly after each file is imported. Could anyone please let me know any solution or work around to achieve this.

    Your help is greatly appreciated.

    Thanks,

    -Amith Vemuganti

  • Amith,

    Within your ForEach loop container, you can map the filename to a variable. After you extract the data from the file (using a DataFlow within that loop), you can then move the file using the Filesystem task. Specify the same variable defined for the filename in the ForEach loop for your source and write the file to your archive folder.

    Post back again if you need more help.

    hth,

    Tim

  • Thanks for the reply Tim!

    I can specify the same variable in File System Task Source. However my destination is dynamic and I want to use a variable. I'm not sure how can I copy multiple files to a dynamic destination.

    Please let me know how can I do this.

    Thanks,

    -Amith Vemuganti

  • Amith,

    What is the destination component that you use? Certain data flow components support setting their properties thru Expressions. You can check if your destination component property can be set by checking for a property having a name like : [ ]

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • Are you using a different destination (e.g., a different folder) for each file? If not, you should be all set. If you want to write each file to a different directory you may need to do some scripting or set up parallel processes.

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

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