Answers for "Error Code: 1451. Cannot delete or update a parent row: a foreign key constraint fails (`oms_ug`.`csq_oms_billing_items`, CONSTRAINT `csq_oms_billing_items_ibfk_2` FOREIGN KEY (`site_id`) REFERENCES `csq_cms_sites` (`id`))"

SQL
1

error 1451 (23000): cannot delete or update a parent row: a foreign key constraint fails

SET FOREIGN_KEY_CHECKS = 0; -- to disable FK checks (ex: for delete purpose)
SET FOREIGN_KEY_CHECKS = 1; -- to re-enable FK checks
Posted by: Guest on March-21-2021

Code answers related to "Error Code: 1451. Cannot delete or update a parent row: a foreign key constraint fails (`oms_ug`.`csq_oms_billing_items`, CONSTRAINT `csq_oms_billing_items_ibfk_2` FOREIGN KEY (`site_id`) REFERENCES `csq_cms_sites` (`id`))"

Code answers related to "SQL"

Browse Popular Code Answers by Language