How to run an SSIS package multiple times?

595 Views Asked by At

After much work I managed to create an SSIS package that checks in a table if there are files to be produced, and if there are, it retrieves the data for the first file in the list (with the help of variables that I pass as parameters), produces the file, and sends it to the correct folder.

However, the list of files to be produced has 10 files, and the package only produces the first one on the list, and then the package ends. Because the package managed to update my database table, it will now only show 9 files that remain to be produced (down from 10). If I run the package again, it will once again retrieve the data for the first file in the list (which has gone down from 10 to 9 files to be produced), produce it and end.

Because the package updates the table, it will now contain 8 files to be produced. You get it by now. I have to click "Start" 10 times for all files to be produced. I was wondering if there was a way to do this by only running the SSIS package a single time.

If so, how? Seems quite easy but complicated at the same time. Thanks in advance for any help!

1

There are 1 best solutions below

0
On

I don't have the details or specifics of your package, but generally when you want to repeat a process until inputs are exhausted, you wrap your task in a foreach loop container. check out this documentation:

https://learn.microsoft.com/en-us/sql/integration-services/control-flow/foreach-loop-container?view=sql-server-ver15