Skip to content

Instantly share code, notes, and snippets.

@xlbruce
Created December 14, 2016 20:17
Show Gist options
  • Save xlbruce/011d47b75fdb8ec506a923e66b205c22 to your computer and use it in GitHub Desktop.
Save xlbruce/011d47b75fdb8ec506a923e66b205c22 to your computer and use it in GitHub Desktop.
List all tables that have a foreign key given a table name
SELECT *
FROM
KEY_COLUMN_USAGE
WHERE
REFERENCED_TABLE_NAME = 'table_name'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment