question

venkatreddy avatar image
venkatreddy asked

How to know when statistics updated last.

Hi all,

I want to know when the statistics has been updated last in the production database.Is there any DMV to check? or should we create a table with time stamp to record the information.Thanks in advance.

t-sqlperformancestatistics
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Fatherjack avatar image
Fatherjack answered

you could use STATS_DATE described here http://msdn.microsoft.com/en-us/library/ms190330.aspx

eg

USE AdventureWorks;
GO
SELECT name AS stats_name, 
    STATS_DATE(object_id, stats_id) AS statistics_update_date
FROM sys.stats 
WHERE object_id = OBJECT_ID('Person.Address');
GO
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.