Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set DB Recovery Mode via T-SQL 1

Status
Not open for further replies.

JayKusch

MIS
Oct 30, 2001
3,199
US
Is there a command in T-SQL that will set the recovery mode of a database?

I have over 2000 DB remotely that I need to set the recovery mode for and do not wish to do it manually.

Thanks

J. Kusch
 
ALTER DATABASE database_name
SET RECOVERY [FULL | BULK_LOGGED | SIMPLE]

You can first query out result like the following.According to the databases which model you want them to be.Them run them at one time!

ALTER DATABASE MyDB1
SET RECOVERY FULL
Go

ALTER DATABASE MyDB2
SET RECOVERY FULL
Go

ALTER DATABASE MyDB1
SET RECOVERY FULL
Go
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top