Is there a query that will get me foreign keys directed at a specific table column? For example, say I had these three tables:
__________
|Table A |
----------
|Id |
----------
___________
|Table B |
-----------
|Id |
|TableAId | (Foreign Key to TableA.Id)
-----------
___________
|Table C |
-----------
|Id |
|TableAId | (Foreign Key to TableA.Id)
-----------
I need a query along the lines of "Select * Foreign Keys directed at TableA.Id" that returned "Table C: TableAId", "Table B: TableAId". I'm browsing through some of the INFORMATION_SCHEMA system views, and it seems like I can easily see what foreign keys belong to Table A, or Table B individually, but I can't find where it says "Table C has a foreign key to Table A" specifically. I can figure out the specifics of the query, I just can't find the views I'm looking for (or I'm glossing over them). Any help would be appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…