Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

cannot truncate a table referenced in a foreign key constraint

SET FOREIGN_KEY_CHECKS = 0; 
TRUNCATE table $table_name; 
SET FOREIGN_KEY_CHECKS = 1;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #truncate #table #referenced #foreign #key #constraint
ADD COMMENT
Topic
Name
8+4 =