views:

1140

answers:

2

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?

+1  A: 

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"
SQLMenace
Is there a way I can get it to prompt me for that when I execute the package, so I wouldn't have to go into it and change it each quarter?
Wayne M
make it dynamic or add something like this in a script task MsgBox("Change connection") just be aware that if this runs from a job that it will wait for that box to be clicked (which of course it can't be)
SQLMenace
A: 

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.

Dayton Brown