Link to home
Start Free TrialLog in
Avatar of JRockFL
JRockFLFlag for United States of America

asked on

List foreign keys for a specified table

I'm trying to list all of the foreign key relationships for a specified table.

I was thinking I could use
sp_fkeys 'enrollments' but this is not returning the desired results.
ASKER CERTIFIED SOLUTION
Avatar of BrandonGalderisi
BrandonGalderisi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Which version of SQL Server?  With 2005 you can use the Sys.foreign_keys table to link to Sys.objects, though I think you may need Sys.columns also as foreign keys apply to columns rather than tables....