发布网友 发布时间:2022-04-08 22:19
共3个回答
懂视网 时间:2022-04-09 02:41
select 2 a.name as 约束名, 3 object_name(b.parent_object_id) as 外键表, 4 d.name as 外键列, 5 object_name(b.referenced_object_id) as 主健表, 6 c.name as 主键列 7 from sys.foreign_keys A 8 inner join sys.foreign_key_columns B on A.object_id=b.constraint_object_id 9 inner join sys.columns C on B.parent_object_id=C.object_id and B.parent_column_id=C.column_id 10 inner join sys.columns D on B.referenced_object_id=d.object_id and B.referenced_column_id=D.column_id
sqlserver查看所有的外键约束
标签:
热心网友 时间:2022-04-08 23:49
这个应该是说看表是否有外键关系。热心网友 时间:2022-04-09 01:07
下面结果中从左到右分别是: