Created
January 6, 2017 00:05
-
-
Save jeffjohnson9046/fe7d0fb9886ef14951678b8b97602d6f to your computer and use it in GitHub Desktop.
MySQL - Identify other tables that reference a table by a foreign key constraint
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
SELECT * | |
FROM information_schema.KEY_COLUMN_USAGE | |
WHERE table_schema = /* the schema you're interested in */ | |
AND referenced_table_name = /* name of the table that is referenced by other tables via foreign key */; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment