Exporting from an old DB structure to new DB structure
I have inherited a database that has no real referential integrity at all, so I've created a new database with this corrected. The problem I have now, is that I have large amounts of data (around 50million rows) with previously assigned IDs. I need to keep these IDs in my new Database else I'll lose a lot of references from the data. So, initially I thought of tur开发者_运维技巧ning off the Identity on the columns, and then insert the data and switch it on.
Does this sound like a feasible plan? Are there any flaws to this? Has anyone tried and tested it?
SET IDENTITY_INSERT ON
is just for these cases. Don't forget to adjust identity counters after insert.
精彩评论