Returns the date that the statistics for the specified index were last updated.
Returns NULL on error or if a caller does not have permission to view the object.
In SQL Server 2005, a user can only view the metadata of securables that the user owns or on which the user has been granted permission. This means that metadata-emitting, built-in functions such as STATS_DATE may return NULL if the user does not have any permission on the object. For more information, see Metadata Visibility Configuration and Troubleshooting Metadata Visibility.
The following example returns the date of the last time that the statistics were updated for the specified object.
USE AdventureWorks; GO SELECT name AS index_name, STATS_DATE(object_id, index_id) AS statistics_update_date FROM sys.indexes WHERE object_id = OBJECT_ID('Person.Address'); GO