New answers tagged referential-integrity
If you are sure enough that all constraints would be met..You can think off turning off the foreign key checks and after making sure that all constraints are ok, you can turn on foreign key checks. You can write a script to verify that if all constraints are ok. use following to turn off foreign key checks set foreign_key_checks=0 use following ...
There is no way round the restriction with truncate as other answers have indicated, but you can of course use delete without disabling the constraints: delete from parent; Note that 'delete' and 'truncate' have different side-effects
Top 50 recent answers are included