Friday, March 23, 2012

script to enable auto-create stats on all databases

Can i have a script that will enable the auto-create stats on every database
in one click if not already done so ?
ThanksHi,
Execute the below query. This will enable Auto create statistics in all
databases.
EXEC sp_MSforeachdb @.command1="sp_dboption '?','auto create
statistics','true'"
Thanks
Hari
SQL Server MVP
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23WkwPwP3GHA.3464@.TK2MSFTNGP03.phx.gbl...
> Can i have a script that will enable the auto-create stats on every
> database in one click if not already done so ?
> Thanks
>sql

No comments:

Post a Comment