SQL SERVER数据库索引、外键查找
1、索引查找
select a.name as tabname
,h.name as idname,h.type_desc
from 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_desc
from sys.objects as a
right join sys.foreign_keys as h on a.object_id=h.parent_object_id
where a.type<>'s'
order by tabname
go