Question

I'm a newbie to using SSIS for data imports - I have a couple of files that I want to import into my database schema, but I'm going to need to run this once every 3 months; the file names change based on the quarter e.g. SKU1QTR will become SKU2QTR.

How can I handle a situation like this with SSIS? Is there a way to specify the file names (there are at least 6 files like this) or, better yet, just specify the numeric portion since the rest of the file always stays the same?

Was it helpful?

Solution

Create a script task and do something like this, where FlatFileCSV would be the name of your connection

Dts.Connections("FlatFileCSV").ConnectionString = 
"E:\SomeFile" + theDate.ToString("yyyyMMdd") + ".csv"

OTHER TIPS

Put your filename/connection string in a configuration file. If that truly is the only thing that is different, then you can even run the package from command line and you won't need to open BIDS at all.

As you are a self described newbie, this is a bit more advanced, but it is a technique worth knowing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top