Created
March 13, 2019 11:14
-
-
Save arjunKumbakkara/eb4219abfb3e946979017b3a31b63cd1 to your computer and use it in GitHub Desktop.
Truncate a table with Foreign Key Constraints (If the SET FOREIGN KEY =0 doesnt work then)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Classic method: Turn off the Foreign Keys and | |
#SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS; | |
#SET FOREIGN_KEY_CHECKS=0; | |
DO YOUR CHANGES!! | |
#SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; | |
If Not: | |
Alternative: | |
SET SQL_SAFE_UPDATES = 0; | |
DELETE FROM WFM_SkillLevelDesignationMapper; | |
ALTER TABLE WFM_SkillLevelDesignationMapper AUTO_INCREMENT = 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment