September 20, 2008 at 9:59 am
I have successfully setup an SSIS package to update another sql server however it appears it is appending the data as opposed to wiping everything and copying over. I suspect this because I get a duplicate primary key error in one of the tables. Is there a way of the clearing the tables I am about to copy before send the ssis package?
September 20, 2008 at 9:19 pm
"truncate table" as the first step in the package.
September 22, 2008 at 7:50 am
If you have any foreign keys you cannot use truncate nor can you delete any rows that have "child" rows. For example if I have orders and order_details with a foreign key on order_id then I cannot delete any rows in orders that have rows in order_details so in my ssis package I would need to purge order_details, then orders, and then re-load orders and order_details.
Another option is to use a lookup and send the "error" rows (rows without a match) to the table and discard the other rows.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply