Created
February 6, 2014 09:24
-
-
Save arabsalem/8840990 to your computer and use it in GitHub Desktop.
List foreign keys in mysql
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 | |
concat(table_name, '.', column_name) as 'foreign key', | |
concat(referenced_table_name, '.', referenced_column_name) as 'references' | |
from | |
information_schema.key_column_usage | |
where | |
referenced_table_name is not null | |
and table_schema = 'gms.drc.dk' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment