Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2016-07-20
3
Medium Priority
?
150 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 14

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 14

Accepted Solution

by:
Nakul Vachhrajani earned 2000 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

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

636 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