Discussion in 'SQL Server 2005 General DBA Questions' started by Trev256b, Nov 11, 2011.
how do i check the statistics are updated? i can't find anything in BOL for this?
SELECT o.name ,
i.name AS [Index Name] ,
STATS_DATE(i.[object_id], i.index_id) AS [Statistics Date] ,
FROM sys.objects AS o WITH ( NOLOCK )
INNER JOIN sys.indexes AS i WITH ( NOLOCK ) ON o.[object_id] = i.[object_id]
INNER JOIN sys.stats AS s WITH ( NOLOCK ) ON i.[object_id] = s.[object_id]
AND i.index_id = s.stats_id
WHERE o.[type] = 'U'
ORDER BY STATS_DATE(i.[object_id], i.index_id) ASC
Separate names with a comma.