Difference between sp_updatestats and dbcc updateusage

  • Hi,

    What is the main difference between sp_updatestats and DBCC UPDATEUSAGE?

    Which one to use when?

    Thanks in Advance.

  • They are completely unrelated and do totally different things.

    sp_updatestats runs a statistics update (using UPDATE STATISTICS) across all the statistics in the database where the underlying table has had at least one row changed since the last statistics update.

    DBCC UPDATEUSAGE fixes incorrect page-usage metadata in the storage engine. It was needed on SQL 2000 because there were bugs in the algorithms that were supposed to keep the page usage metadata correct. It should not be needed any longer on SQL 2005, as those bugs were supposedly fixed during the development of SQL 2005, though at least one persisted until SP3.

    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!

Viewing 3 posts - 1 through 2 (of 2 total)

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