I am trying to compare two tables that are exactly the same. I have run SQL Compare and verified their structures are identical. Now I am trying to copy the data from one to the other using SQL Data compare but I keep getting a "PRIMARY KEY constraint: Cannot insert duplicate key in object". Why would I be getting this when the source table has the same structure?? I can't have a duplicate primary key in the source obviously so how is it that I am getting this error??

Thanks for your help.

Chris Clement
ChrisClement
0

Comments

3 comments

  • ChrisClement
    I'm getting that PK constraint error even when I'm not including the table generating that error.
    ChrisClement
    0
  • ChrisClement
    There was a trigger on another table that was the cause of the problem. I disabled triggers in SQL Data Compare and everything worked fine.
    ChrisClement
    0
  • Brian Donahue
    Hi Chris,

    Sorry I didn't get around to you more quickly. If it's a data integrity problem, you should definitely check the options in Data Compare and see about disabling the triggers, foreign and primary keys.
    Brian Donahue
    0

Add comment

Please sign in to leave a comment.