One of the problems that I see a lot is that when trying to restore the relationship there are orphans on the tables. Ensure that all the foreign keys from the parent are present on the tables. For example. If table A has ID ( 1,2,3,4,5,6) and a child table B has the FK's (1,4,5,6) After dropping all the constraints we delete the records (5,6) on table A but fail to delete records (5,6) on table B, the script will fail to restore the constraint between Table A and B because now B has FK's (5,6) as orphans. The issue can be many things but I will start to look into the orphan issue First. Can you send the DDL of the tables? or a similar DDL I just want to see the kind of constraint between the tables.