RSS Feed

Setting All Databases to SIMPLE Recovery Mode

3

November 7, 2011 by Mike Hillwig

I’m cleaning up some stuff in my dev environment today, and I have some pretty big transaction log files. These have gotten big even though I do regular full and transaction log backups. In order to do some maintenance work, I wrote this little nugget this morning. It’s anther script that generates a script.

Again, this is for my DEV environment. I’d never advise someone to run all databases in SIMPLE recovery mode in a production environment unless there was a very specific need to do that.
[SQL]
set nocount on
go
select ‘ALTER DATABASE [‘ + name + ‘] SET RECOVERY SIMPLE’
from sys.databases
where database_id > 6
and recovery_model_desc = ‘FULL'[/SQL]


3 comments »

  1. fezhmffhjn says:

    Muchas gracias. ?Como puedo iniciar sesion?

  2. Your place is valueble for me. Thanks!…

  3. erjilopterin says:

    Hello, i feel that i saw you visited my web site so i came to “go back the choose”.I am attempting to in finding issues to enhance my web site!I suppose its adequate to use some of your concepts!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Search

Pages