开发者

Exporting from an old DB structure to new DB structure

开发者 https://www.devze.com 2022-12-21 09:06 出处:网络
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 50mi

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消