Copy some data from one set of related tables to another using ssis -


i need archive 10 days old data archive database tables, can please me understand how copy data 1 set of related tables another, including dependent rows, while preserving correct relationships between rows.

this diagram shows data model source , target sets of tables:

source & destination tables

same table structure @ archive database.

you should able achieve using "data flow task", 1 each table. start tables not have dependencies (table in diagram) , copy data source table target table using appropriate data source , target components ssis toolbox. after copy data of tables depend on these first tables (table b) , on.

if primary key columns in source tables somehow computed (for example through using identity increments) respective columns within archive tables should of same data type, however, should not computed because mess dependencies. can still primary keys, though.

update: regarding 10 days old part: in data source component can use sql queries read specific rows need. long can make sure ssis job not start on 1 day , runs until after midnight (i.e. runs on 1 day), can calculate date part in where conditions of these queries. cleaner solution calculate date before first data flow task , pass each of data flow tasks variable. way can make sure queries use same date value.


Comments