Execute SSIS task when a given list of files exist

I have a working SSIS task that executes once in a month and runs trough a given path, iterating though various XML files and inserting their contents on an SQL Server database.

On the last meeting with the area who determines the rules for that SSIS task, it was stated that the task can only run after all the files expected are present on the path. The files in question are in a number of 35. Their name is TUPSTATUS_SXX.xml, where XX estates for a number from 01 to 35 (35 telecommunication sectors here in Brazil). Those files are generated by the telecom companies that operate each one of those sectors.

So, my question is: how to run an SSIS task only after all the 35 files are present on our directory?

Upvotes: 0

Views: 775

Answers (2)

Vivek
Vivek

Reputation: 259

Instead of doing a busy wait on the folders with your SSIS process running continuously, why not set up a FileSystemWatcher which will trigger on file system conditions. Use it to invoke your SSIS package. you can implement this watcher in either a service(if required for a longer time), or a simple application .

Another way is to have a simple application/script to check for the count, which will be invoked from task scheduler.

Upvotes: 2

grapefruitmoon
grapefruitmoon

Reputation: 3008

You could use a Script Task that will count the files in the folder, and only execute further down the pipeline when 35 files exist. Although if the files are large and being transferred by FTP, the final file may exist, but not have fully transferred at that point.

Upvotes: 1

Related Questions