查询哪些表没有聚集索引
程序员文章站
2022-06-05 12:18:10
...
--查询哪些表没有聚集索引
SELECT * FROM (
SELECT t.name AS tableName,(SELECT TOP 1 name FROM sys.indexes AS i WHERE i.type_desc='CLUSTERED' AND t.[object_id]=i.[object_id]) AS clusteredIndexName
FROM sys.tables AS t
)AS t
WHERE clusteredIndexName IS NULL
ORDER BY tableName