In this post, we will see how to retrieve the information on when a Statistics was last updated.
To retrieve this information, run the below query on one of the database.
SELECT OBJECT_NAME(OBJECT_ID) AS TableName, name AS IndexName, Type_desc AS IndexType, TableType=Case When OBJECTPROPERTY(OBJECT_ID,'IsUserTable')=0 Then 'SystemTable' When OBJECTPROPERTY(OBJECT_ID,'IsUserTable')=1 Then 'UserTable' END, STATS_DATE(OBJECT_ID, index_id) AS StatsUpdatedDate
FROM sys.indexes
Where OBJECTPROPERTY(OBJECT_ID,'IsUserTable')=1
Order by TableName
This query will list the indexes present on all of the user tables in a particular database and when their Statistics was last updated.

1 comment:
Another option is to use the sp_autostats. This will give the stats last updated date.
Post a Comment