Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Cannot truncate a table referenced in a foreign key constraint (`video_clips`.`channel_clips`, CONSTRAINT `clips_fk` FOREIGN KEY (`clip_id`) REFERENCES `video_clips`.`clips` (`id`)) in sql]

SET FOREIGN_KEY_CHECKS = 0; 

truncate table "yourTableName";

SET FOREIGN_KEY_CHECKS = 1;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Cannot #truncate #table #referenced #foreign #key #constraint #CONSTRAINT #FOREIGN #KEY #REFERENCES
ADD COMMENT
Topic
Name
7+5 =