获取有关外键约束的信息
sys.foreignkeys 系统视图返回有关数据库中所有外键关系的信息:
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