首页 > 数据库 > SQL Server > 正文

SQL SERVER数据库索引、外键查找

2024-08-31 00:55:51
字体:
来源:转载
供稿:网友
SQL SERVER数据库索引、外键查找

1、索引查找

select a.name as tabname ,h.name as idname,h.type_descfrom sys.objects as a right join sys.indexes as h on a.object_id=h.object_id where a.type<>'s' order by tabname go

2、外键查找

select a.name as tabname,h.name as idname,h.type_descfrom sys.objects as a right join sys.foreign_keys as h on a.object_id=h.parent_object_idwhere a.type<>'s' order by tabnamego


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表