set Auto Update Statistics ON

  • hi guys , is there a way to set Auto Update Statistics ON for all my DBs in an instance by script instead of by the GUI?

  • This is an undocumented script like SP_MSForEachTable...

    Try:

    exec sp_msforeachdb @command1='ALTER DATABASE ? SET AUTO_UPDATE_STATISTICS ON'

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

  • search with AUTO_UPDATE_STATISTICS which is database property and can set by executing T-sql ALTER DATABASE command.

    Also you can write a cursor for the same but sp_msforeachdb is good one.

    HTH

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

  • thank you guys!!

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

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