Solved

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

Posted on 2016-07-20
3
87 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 12

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 12

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
t-sql Joining Issue 10 40
sqlserver get datetime field and create a string 5 18
SQL server vNext 18 29
SQL2016 to ORACLE11G linked-server 6 13
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

772 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