Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
216 views
in Technique[技术] by (71.8m points)

sql - What is the best way to delete records from one table with over 100 foreign keys?

I know this is not recommended practice. But we need to delete sensitive historical data from one table that has foreign key restraints on about 100 hundred tables so we can QA the consequences. We do not want to delete associated records in other tables.

Is it best to carefully disable every foreign key constraint one at a time? I am looking in to alternatives such as cascade options and global foreign key constraint disabling. Are these safe approaches? I just want to safely disable all the foreign keys and re-enable them in a safe and reliable manner.

question from:https://stackoverflow.com/questions/65892669/what-is-the-best-way-to-delete-records-from-one-table-with-over-100-foreign-keys

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...