Created
January 23, 2014 19:09
-
-
Save tomzx/8584838 to your computer and use it in GitHub Desktop.
List all FK relations
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 | |
ke.referenced_table_name parent, | |
ke.table_name child, | |
ke.constraint_name | |
FROM | |
information_schema.KEY_COLUMN_USAGE ke | |
WHERE | |
ke.referenced_table_name IS NOT NULL | |
ORDER BY | |
ke.referenced_table_name; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment