Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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 
Comment

sqlstate[23000]: integrity constraint violation: 1451 cannot delete or update a parent row:

Schema::disableForeignKeyConstraints();
Schema::dropIfExists('tablename');
Schema::enableForeignKeyConstraints();
Comment

ERROR 1451: 1451: Cannot delete or update a parent row: a foreign key constraint fails

SET FOREIGN_KEY_CHECKS=0; -- to disable them
SET FOREIGN_KEY_CHECKS=1; -- to re-enable them
Comment

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 
Comment

sqlstate[23000]: integrity constraint violation: 1451 cannot delete or update a parent row:

Schema::disableForeignKeyConstraints();
Schema::dropIfExists('tablename');
Schema::enableForeignKeyConstraints();
Comment

ERROR 1451: 1451: Cannot delete or update a parent row: a foreign key constraint fails

SET FOREIGN_KEY_CHECKS=0; -- to disable them
SET FOREIGN_KEY_CHECKS=1; -- to re-enable them
Comment

PREVIOUS NEXT
Code Example
Sql :: sql if null then string 
Sql :: update set table column to null 
Sql :: sql datum formatieren 
Sql :: influxdb delete measurement based on date 
Sql :: client does not support authentication protocol requested by server sqlyog 
Sql :: sql insert values into table 
Sql :: case insensitive sql 
Sql :: new uniqueidentifier in sql 
Sql :: php delete database 
Sql :: sql where not like in list 
Sql :: how to find 2nd highest salary in a table 
Sql :: android sqlite query join 
Sql :: php insert null mysql 
Sql :: create db table 
Sql :: local database sql 
Sql :: mysql default port number 
Sql :: sql insert into statement 
Sql :: how to use query in nosql 
Sql :: date less than in sql 
Sql :: sql limit order by 
Sql :: select only unique values from and to current table 
Sql :: mysql error 1114 (hy000) the table is full 
Sql :: insert multiple rows from another table sql 
Sql :: SQL isnumeric DB2 
Sql :: alter session set nls_language french 
Sql :: update field in sql to null 
Sql :: postgres between dates 
Sql :: oracle disk group space 
Sql :: delete row mysql 
Sql :: mysql even numbers 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =