Posts
1150
Comments
891
Trackbacks
1
SQL Server: When were my indexes and statistics updated?

From http://weblogs.sqlteam.com/joew/archive/2007/08/31/60316.aspx, use these queries to check when statistics for indexes were last updated.

SELECT t.name AS Table_Name
,i.name AS Index_Name
,i.type_desc AS Index_Type
,STATS_DATE(i.object_id,i.index_id) AS Date_Updated
FROM sys.indexes i
JOIN sys.tables t
ON t.object_id = i.object_id
WHERE i.type > 0
ORDER BY t.name ASC ,i.type_desc ASC ,i.name ASC

SELECT name AS stats_name
,STATS_DATE(object_id, stats_id) AS statistics_update_date, *
FROM sys.stats
order by STATS_DATE(object_id, stats_id)

 

posted on Thursday, November 04, 2010 9:13 AM Print
Comments
No comments posted yet.

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 5 and 1 and type the answer here: