Solved

Need LoopForEach function for SSIS to Archive processed files

Posted on 2012-03-16
4
346 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
ID: 37730249
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
ID: 37730263
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
ID: 37731090
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
ID: 37731230
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

679 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