开发者

What is the best procedure to update thousands of rows in the tables having key constraints

I know that any RDBMS wont allow to update the table due to foreign key constraints. So i had copied the table {newtablen开发者_如何学编程ame} using:

 create table table_name select * from table_org; 

By following this process, key fields will not be copied, after carrying out data modifications in copied table rows, deleting the master table, renaming the copied table to original table and updating the table definition to add the key fields ( relations) by executing script which was copied using :

 show create table table_name; 

By executing the script adding the Primay key, keys, constraints and rebuilding the relations. Is this a better procedure to to update rows for the tables having index and key constraints, or please suggest a simple procedure to update rows.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜