Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
1 1 11
Impact
~22k people reached

  • 0 posts edited
  • 0 helpful flags
  • 11 votes cast
Apr
7
awarded  Popular Question
Feb
25
awarded  Famous Question
Feb
20
awarded  Teacher
Feb
16
awarded  Popular Question
Sep
24
awarded  Autobiographer
Jul
8
awarded  Notable Question
Jun
2
awarded  Popular Question
Mar
1
awarded  Popular Question
Jan
11
comment How to Find the Foreign Key Associated with a Given Primary Key
The simple answer is that I want both and the accepted answer gives me means to do this...
Jan
11
comment How to Find the Foreign Key Associated with a Given Primary Key
I need all of the constraint information for any given column (if any). I want to construct a database class that holds all the information for a given database. This class structure database.table.column.constraints will then be used to get the matches between different columns on PK/FKs. Clearly some columns will have FKs only and in this case I also want to retrieve the PK information of the corresponding key; some will have only PKs and then I want the reverse. Some of course can have both. Sorry if this also does not answer you question.
Jan
10
comment How to Find the Foreign Key Associated with a Given Primary Key
I am creating a script genrator for QlikView. To generate the script I need the constraints and the ascociated links.
Jan
10
comment How to Find the Foreign Key Associated with a Given Primary Key
Thanks for your time Aaron. Much appreciated.
Jan
10
accepted How to Find the Foreign Key Associated with a Given Primary Key
Jan
10
comment How to Find the Foreign Key Associated with a Given Primary Key
Thanks again. When I can bounty this I will do...
Jan
10
comment How to Find the Foreign Key Associated with a Given Primary Key
Thanks very much for your time here. It is most appreciated. Where can I get one of those posters!? It looks like you might be able to use INFORMATION_SCHEMA.KEY_COLUMN_USAGE? This is making me feel very weak!
Jan
10
awarded  Commentator
Jan
10
comment How to Find the Foreign Key Associated with a Given Primary Key
Ps. I am going to bounty this so you can have some rep!
Jan
10
comment How to Find the Foreign Key Associated with a Given Primary Key
That is absolute quality. I have been hacking around with a three teir JOIN simalar to the 1st, 2nd and 4th above. Great to see an answer like this - so difinitive! Now, two additonal things if I may be so bold. How do you find out about the poentail links between such system table and thus easyly come up with the above? or is it experience? Exending this to include the actual PK name is also not obvious to me - could you extend the answer to include this please?
Jan
10
revised How to Find the Foreign Key Associated with a Given Primary Key
added 519 characters in body
Jan
10
asked How to Find the Foreign Key Associated with a Given Primary Key