Todd C replied to Bob Barrows
18-Nov-09 08:54 AM

Actually, I would not use my Config database for this. I reserve that
primarily for Connection Strings and other values that change when migrating
a package from DEV to TEST to PROD (though it would certainly work).
I would set up a 'control' table;
CREATE TABLE dbo.YearList (
LoadYear INT,
LastLoaded DateTime )
Populate it with all the years you want loaded, leaving the DateTime field
as NULL.
Then first Task on your Control Flow, have an Execut SQL Task with:
SELECT MIN(LoadYear)
FROM dbo.YearList
WHERE LastLoadeded IS NULL
That should return a single INT value, which you would put into a Package
Variable using the Result Set. Now use that Package Variable as a parameter
when you do all your SELECT statements against the Oracle Db.
Lastly, you need to update the control table to tell it that the particular
year was loaded. Do this with another Execute SQL task:
UPDATE dbo.YearList SET LastUpdated = GETDATE() WHERE LoadYear = ?
and map the Package Variable to the parameter.
Now you have a package that you can run once a night and it will always get
a different year each time, without you needing to do any manual table
manipulation.
HTH. Good luck.
=====
Todd C