Skip to content

Instantly share code, notes, and snippets.

@mapsi
Created December 11, 2014 15:00
Show Gist options
  • Save mapsi/91f72ed08dc48c929aab to your computer and use it in GitHub Desktop.
Save mapsi/91f72ed08dc48c929aab to your computer and use it in GitHub Desktop.
Find tables that have a referential constraint on a table_name
SELECT *
FROM information_schema.REFERENTIAL_CONSTRAINTS
WHERE REFERENCED_TABLE_NAME = 'table_name'
AND CONSTRAINT_SCHEMA='scheman_name';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment