update statistics

  • 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

  • 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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • 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

  • 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."

  • Thanks Dude!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply