Skip to content

Instantly share code, notes, and snippets.

@adrianosaaquino
Created March 12, 2015 15:46
Show Gist options
  • Save adrianosaaquino/97c7f505e3ab50235c78 to your computer and use it in GitHub Desktop.
Save adrianosaaquino/97c7f505e3ab50235c78 to your computer and use it in GitHub Desktop.
MySql - Check foreign key existents
USE information_schema;
SELECT * FROM KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_NAME = 'table_name' AND REFERENCED_COLUMN_NAME = 'table_column' and TABLE_SCHEMA = 'schema_name';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment