Created
February 27, 2017 07:28
-
-
Save hr-sadooghi/e10224ea7e97872dcb41382984883d79 to your computer and use it in GitHub Desktop.
MySQL: How do I find out which tables reference a specific table?
This file contains hidden or 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
| select table_name | |
| from information_schema.KEY_COLUMN_USAGE | |
| where table_schema = 'database_name' | |
| and referenced_table_name = 'table_name'; | |
| -- http://stackoverflow.com/questions/754512/mysql-how-do-i-find-out-which-tables-reference-a-specific-table/754582#754582 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment