Solved

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

Posted on 2016-07-20
3
120 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

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.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

729 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