Created
September 19, 2014 08:05
-
-
Save bindiego/3991c953f6bc3efb36b6 to your computer and use it in GitHub Desktop.
Get a list of all foreign key constraints pointing to a particular table, a particular column.
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 | |
TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME | |
from INFORMATION_SCHEMA.KEY_COLUMN_USAGE | |
where | |
REFERENCED_TABLE_NAME = '<table>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment