Hello everyone i'm pretty new to ssis,
So the situation:
local db with a number of tables copied from a production db. The data in this local database gets supplied on a monthly basis in the form of txt files with delimiters. However sometimes the structure of the tables can change e.g. an extra column, et cetera. So I roughly thought about the following approach:
ps: Due to let's call it politics, a backup is out of the question. The available items are sql generated scripts for creation, dropping, etc. + txt delimited files for the data.
- Disable all constraints in local tables (sql task)
- Drop all tables from database (sql task)
- Dynamically retrieve filename for file that contains create tables script (foreach loop parameter variable mapping = put full path for connectionstring in a variable)
- Create file connection with dynamic connectionstring (above filled up variable )
- Execute sql task from file (connection to the dynamic file connection). This will fire the create table statements. I'm going to ask for scripts without indexes and constraints creation.
--> the above works fine for recreating the tables.
To continue (haven't tested this yet)
- Bulk insert the txt files (these files can be as big as 3 GB)
- Create indexes and constraint through scripts generated from production environment (using file connections)
- also archive all the files and include some error handling and such
- Deploy the package to the server and include it in a monthly job
Is this a good approach?
Thanks in advance for your input ;-)