SQL Script to set the database recovery model in SQL Server

If you would like to change the database recovery model on your SQL Server database you can use the ALTER DATABASE command.

To set your database recovery model to full you can execute the following statement:

-----------------------------------
ALTER DATABASE [test] SET RECOVERY FULL WITH NO_WAIT;
-----------------------------------

To set your database recovery model to simple you can execute the following statement:

-----------------------------------
ALTER DATABASE [test] SET RECOVERY SIMPLE WITH NO_WAIT;
-----------------------------------

To set your database recovery model to bulk logged you can execute the following statement:

-----------------------------------
ALTER DATABASE [test] SET RECOVERY BULK_LOGGED WITH NO_WAIT;
-----------------------------------

2 thoughts on “SQL Script to set the database recovery model in SQL Server

Leave a reply to sudheer gandavarapu Cancel reply