代码如下:DECLARE cur CURSOR FOR SELECT [object_name]=s.name+’.’+OBJECT_NAME(A.object_id), B.name FROM sys.dm_db_index_physical_stats(DB_ID(‘AdventureWorks’),NULL,null,null,null) AS A JOIN sys.indexes AS B ON A.[object_id]=B.[object_id] AND A.[index_id]=B