Solved

SSIS Foreach Loop repeating itself more than once on a file.

Posted on 2016-07-20
3
93 Views
Last Modified: 2016-07-28
Hello

I have a SSIS Foreach loop,and within it a Sequence Container that keeps looping over the same specified file more than once, thereby creating duplicates in the destination table.

Is there a way i can have to loop files within a folder just once, one-by-one?
0
Comment
Question by:barkome
  • 2
3 Comments
 
LVL 13

Expert Comment

by:Nakul Vachhrajani
ID: 41722182
Do you move the file that has been processed to another folder?

Also, do confirm that the iterator is configured correctly and that the value fetched from the iterator is used in the tasks inside the ForEach Loop (e.g. maybe the loop may be iterating over 10 files correctly, but all the 10 times, the tasks inside the ForEach loop are referencing the same file due to some hard-coding)
0
 

Author Comment

by:barkome
ID: 41725009
I do, but thinking of how to get the the ForEach loop to start with one file first, then begin with the second file
0
 
LVL 13

Accepted Solution

by:
Nakul Vachhrajani earned 500 total points
ID: 41725806
Oh okay, I have attached a sample SSIS package that process files in a folder one by one.

(FYI - EE doesn't allow uploading DTSX files, so I have renamed it to XML. Request you to please rename it back to DTSX).
002A_FileRenameForMove.xml
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

860 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