I have about 29 servers that I need to set all db_options for, and they will
be the same on all servers.
Do you know the syntax for changing all database recovery types to "simple"?
Also, I need to change all db_options for AutoShrink to "false". I don't
want to go one by one, so I was hoping someone knows a shortcut.
Thanks,
Michelle-- undocumented, unsupported!
EXEC sp_MSForEachDB 'IF ''?'' != ''TEMPDB'' EXEC(''ALTER DATABASE [?] SET
RECOVERY SIMPLE'')'
http://www.aspfaq.com/
(Reverse address to reply.)
"JaneDoe" <JaneDoe@.discussions.microsoft.com> wrote in message
news:6B34E6BF-DF65-40C6-9623-07E3B7D0AA48@.microsoft.com...
> I have about 29 servers that I need to set all db_options for, and they
will
> be the same on all servers.
> Do you know the syntax for changing all database recovery types to
"simple"?
> Also, I need to change all db_options for AutoShrink to "false". I don't
> want to go one by one, so I was hoping someone knows a shortcut.
> Thanks,
> Michelle|||JaneDoe wrote:
> I have about 29 servers that I need to set all db_options for, and
> they will be the same on all servers.
> Do you know the syntax for changing all database recovery types to
> "simple"? Also, I need to change all db_options for AutoShrink to
> "false". I don't want to go one by one, so I was hoping someone
> knows a shortcut.
> Thanks,
> Michelle
Look at ALTER DATABASE in BOL:
SET RECOVERY SIMPLE
SET AUTO_SHRINK OFF
David Gugick
Imceda Software
www.imceda.com|||Deploy a SP on each server (perhaps in master database) that does what you
need. Then have one script that makes a remote call to each server. Also,
perhaps a WSH script that uses DMO to loop through each server, chaning
context and executing commands.
"JaneDoe" <JaneDoe@.discussions.microsoft.com> wrote in message
news:6B34E6BF-DF65-40C6-9623-07E3B7D0AA48@.microsoft.com...
> I have about 29 servers that I need to set all db_options for, and they
will
> be the same on all servers.
> Do you know the syntax for changing all database recovery types to
"simple"?
> Also, I need to change all db_options for AutoShrink to "false". I don't
> want to go one by one, so I was hoping someone knows a shortcut.
> Thanks,
> Michelle
No comments:
Post a Comment