June 8, 2010 at 6:27 am
Hi,
Assuming am running the sp_updatestats against the database manually without a daily job which should be the actaul case on any production environment.
Is there any way through which i can say whether my statistics on a particular database is up-to-date or can i extract from any system table that when the last update stats has been run on my database ???
Thanks in Advance
June 8, 2010 at 6:30 am
You can use the STATS_DATE() function to see when stats were last updated. It won't tell you if they need updating, just when they were updated.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 8, 2010 at 11:54 pm
Thanks Gila!
SELECT distinct object_name(object_id) as ObjName,
--name AS stats_name,
STATS_DATE(object_id, stats_id) AS statistics_update_date
FROM sys.stats
where OBJECTPROPERTY(object_id,'IsUserTable')=1
June 9, 2010 at 2:02 am
You can also use DBCC SHOW_STATISTICS
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
June 9, 2010 at 9:42 am
Thanks Dude!
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply