JRockFL
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.
I was thinking I could use
sp_fkeys 'enrollments' but this is not returning the desired results.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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....