Solved

Need LoopForEach function for SSIS to Archive processed files

Posted on 2012-03-16
4
342 Views
Last Modified: 2012-03-16
Ok, lots of progress on the last solution.  I have the flow working now properly.  I am pulling multiple flatfiles from ftp, processing them, appending them to table in db.  Now I need to archive all the files that are processed with a FOREACH LOOP CONTAINER.  This is where I am stuck.

I have searched various things and have not found a working solution yet.  Any assistance is most appreciated.  

Here is a diagram of the working flow.

Working FLlow
0
Comment
Question by:pskeens
  • 2
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
Barry Cunney earned 500 total points
Comment Utility
Add a ForEach Loop Container component in your SSIS project

Edit it and in the ForEchLoop Editor select Collection

Specifify Foreach File Enumerator as the Enumerator

Specify the name of an already created String variable in Variable Mappings

Insert a File System Task component into the center of the above ForEach loop container

Set the File System Task operation to Move File

Set IsSourcePathVriable = True

Set SourceVariable to the variable specified in Variable Mappings in ForEach Loop container
0
 
LVL 17

Expert Comment

by:Barry Cunney
Comment Utility
In the FileEnumerator specify the folder in where the files to be archived exist

In the File System Task specifiy the Destination to where the files should be archived
0
 
LVL 2

Author Comment

by:pskeens
Comment Utility
Ok, I have the FOREACH lOOP CONTAINER setup.  The job works all the way through without errors, however the files do not get moved to the Archived Folder.

Here is an image of the current flow:

New Flow
I got this warning even though it executed:

"Warning: The For Each File enumerator is empty. The For Each File enumerator did not find any files that matched the file pattern, or the specified directory was empty."
0
 
LVL 2

Author Comment

by:pskeens
Comment Utility
GOT IT!   I just went back and checked all the variable paths again and it started working.  I must have had an extra space or dash in the qualifier perhaps.  

Thanks for the assistance!!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now