日期:2014-05-17 浏览次数:20497 次
SELECT a.name AS tabname ,
h.name AS idname
FROM sys.objects AS a
RIGHT JOIN sys.indexes AS h ON a.object_id = h.object_id
WHERE a.type <> 's' AND h.name IS NOT null
select b.name 'index_name',a.name 'table_name'
from sys.tables a
inner join sys.indexes b on a.object_id=b.object_id
--sql 2000的用下面的
select b.name 'index_name',a.name 'table_name'
from sysobjects a
inner join sysindexes b on a.id=b.id
where a.type ='U'