Foreign Key
am 23.06.2007 12:26:40 von OonzHi Friends,
Is there any way to get the table name which is referenced by the
foreign key
for example: consider two table "Staff" and "Department"
Staff with following columns
PK_ID
FK_DepartmentID
Name
Address
Department with following columns
PK_DepartmentID
DeptName
Actually what i need is: Initially i would be having the table name as
"Staff"
from Staff table i need to identify that the column FK_DepartmentID is
a foreign key
and the primary key is in the Department table
i need to traverse from Staff table and identify that FK_DepartmentID
is a primary key in Department table
this has to be accomplished by sql query.... probably this could be
fetched from
Data Dictionary but i couldnt find the relationship between the system
tables.
Thanks
ArunDhaJ