August 14, 2009 at 1:24 pm
I have a SQL 2005 box that I'd like to convert all recovery models to SIMPLE.
ALTER DATABASE (?all?) SET RECOVERY SIMPLE GO
August 14, 2009 at 1:30 pm
For quick and dirty stuff like that, GOOGLE the undocumented sp_MSForEachDB extended stored procedure. It's got a nasty cursor in it but it is convenient for this type of stuff.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 14, 2009 at 1:36 pm
Just generate that statement for all the databases on the server.
select 'ALTER DATABASE '+name +' SET RECOVERY SIMPLE GO'
from sys.databases
You may want to filter out master, tempdb, etc.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
August 14, 2009 at 2:14 pm
Bob's method eliminates the use of a cursor. If you need to "productionalize" something like that, we can do a little XML concatenation into a variable using his good code and then execute the variable.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 14, 2009 at 2:43 pm
Understood. Thanks for the great responses. Actually, I've found some nifty uses after googling sproc sp_MSForEachDB.
Thanks again guys!
August 14, 2009 at 2:49 pm
You're welcome, and good luck.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply