SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS Import/Export Failed. Duplicate Key even w/ "Delete Rows" Checked


SSIS Import/Export Failed. Duplicate Key even w/ "Delete Rows" Checked

Author
Message
homebrew01
homebrew01
SSCarpal Tunnel
SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)

Group: General Forum Members
Points: 4813 Visits: 9108
Running SQL 2005 SP4
I am trying to use the Import/Export Wizard to copy 40 table from Server A to Server B. After selecting all the tables, I set them all to "Delete Rows In Destination Table" and "Enable Identity Insert".
I deselect "Optimize for Many Tables" so I can save the package & edit it later.

When I run the package as the last step in the Wizard, it fails and tells me I cannot insert a duplicate - Violation of primary key.
There are no duplicates in the source. "TableA" only had 1 record anyway !
When I run it again, "TableA" completes cleanly, but now I get an error that "TableC" has duplicates.

It seems that the truncates and copies are running at the same time, so sometimes a copy is happening before the truncate and throws an error, and sometimes after the truncate and completes normally.

Any thoughts on this crazy situation ?

EDIT: I saved the package, opened it in BIDS, and see that only 4 of the tables have a "truncate" statement even though in the GUI, they all have "Delete Rows In Destination Table" checked ?!?!? WTF ?!?!

EDIT2: I didn't manually check "Delete Rows In Destination Table" on each table. I highlight all the tables, then choose "Edit Mappings" and check "delete" 1 time and it applies to all the tables ..... except I guess it doesn't really apply to all the tables, just LOOKS like it does, since the check mark is there, but it does not execute.

Is there a workaround for this bug ???



Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27261 Visits: 13268
homebrew01 (10/9/2012)

Is there a workaround for this bug ???


Yes, manually set it for each table :-)

Or you can just create truncate table statements for each table and paste it into the package.
What you do yourself, is often better :-)


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search