Sunday, March 11, 2012

Calling a package at Runtime

I am working on a package that will sense a text file in a folder. From this text file I will be extracting the file name which will tell me what task I need to run. How can I create a package that, depending upon what the file name is, call a specific package. To be more clear, I will have 3 different flat files that is each in a standard form. Their names will be unique. To transform their data will require different ETL logic. I will be using a loop to constantly check to see if a file has been put into the directory. I just need to know how I can direct the input file to the proper ETL task.

Use precedence constraints between the task that reads the file and three Execute Package tasks. Store the filename in a variable and use that in an expression on the precedence constraint. Make the expression dependent on the variable being equal to the appropriate file name.|||

As an aside, you should investigate using a WMI Event Watcher Task at control flow level to detect the files' presence rather than a loop. I believe it is much more efficient.

No comments:

Post a Comment