Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

ssis recreate table structure + import data best practices

$
0
0

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.

  1. Disable all constraints in local tables (sql task)
  2. Drop all tables from database (sql task)
  3. Dynamically retrieve filename for file that contains create tables script (foreach loop parameter variable mapping = put full path for connectionstring in a variable)
  4. Create file connection with dynamic connectionstring (above filled up variable )
  5. 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)

  1. Bulk insert the txt files (these files can be as big as 3 GB)
  2. Create indexes and constraint through scripts generated from production environment (using file connections)
  3. also archive all the files and include some error handling and such
  4. Deploy the package to the server and include it in a monthly job

Is this a good approach? 

Thanks in advance for your input ;-)



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>