Microsoft SQL Server Getting information about foreign key constraints


Example

sys.foreignkeys system view returns information about all foreign key relationships in database:

select name,
 OBJECT_NAME(referenced_object_id) as [parent table],
 OBJECT_NAME(parent_object_id) as [child table],
 delete_referential_action_desc,
 update_referential_action_desc
from sys.foreign_keys