Skip to main content
2 of 3
added 232 characters in body; edited tags
Johann
  • 175
  • 1
  • 7

SQL Azure Migration Wizard - Duplicate Primary Key

Just did a test at migrating a 120gb database onto RDS using [SQL Azure Migration Wizard][1]

Because we can't afford any downtime for "just" a test we ran the tool on the live database (meaning data was still getting inserted/updated/deleted while the tool was running)

Scripts were created ok but during the insertion of data we got the error "BCP copy in failed" "Cannot insert duplicate key"

My intuition is because the data was live when the .dat file got created, it somehow read the same row twice, but I don't really want to make an assumption I might regret when we will do the real migration, when the database will obviously be offline.

Could there be any other reason why this has happened and can I assume I'm safe using the tool on the "big day" with a read-only database?

-- Update --

We have tried again to run exact same .dat file of the table that failed and it worked. Which seems to indicate the duplicated key is not in the script... I'm even more confused, could it be a bug in the tool? [1]: https://sqlazuremw.codeplex.com/

Johann
  • 175
  • 1
  • 7