Skip to content

Instantly share code, notes, and snippets.

@WaximeA
Created April 12, 2018 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WaximeA/c46021dcb83cebd57ee8442a5cfc8c0e to your computer and use it in GitHub Desktop.
Save WaximeA/c46021dcb83cebd57ee8442a5cfc8c0e to your computer and use it in GitHub Desktop.
SQL memory-aid

How to truncate a foreign key constrained table?

$ SET FOREIGN_KEY_CHECKS = 0; 
$ TRUNCATE table table_name; 
$ SET FOREIGN_KEY_CHECKS = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment