Microsoft SQL Server 2005 Best Practices


How to find out the last update for the index statistics?


Execute the following script in Query Editor to find out the last update on the indexes of Person.Contact table:

Use AdventureWorks;

SELECT 'Index Name' = i.name,
'Last Statistics Update Date' = STATS_DATE(i.id, i.indid)
FROM sys.objects o, sys.sysindexes i, sys.schemas s
WHERE s.name='Person'
AND o.name = 'Contact'
AND o.object_id = i.id
AND o.schema_id=s.schema_id
ORDER BY i.name


The World Leader in SQL Server Training
SQLUSA.com Home Page