Before you begin backing up a SQL Server database, you need to know which recovery model the database is using. There are three different recovery models: FULL, BULK_LOGGED, and SIMPLE. The FULL recovery model gives you the most recovery flexibility. It's the default recovery option for new databases. This model allows you to restore just part of a database or do a complete recovery. Assuming the transactions logs haven't been damaged, you can also recover up to the last committed transaction prior to a failure. This method uses the most transaction log space of all the recovery models and it causes a slight hit to SQL Server performance. The BULK_LOGGED recovery model has fewer recovery options than the FULL model, but it doesn't have as severe a performance hit on bulk operations. It uses less log space on certain bulk operations because it records only the operations' results. With this model, however, you can't restore to a specific mark in the database, nor can you restore just parts of the database. The SIMPLE recovery model is the easiest of the three to implement and it uses the least amount of storage space. However, recovery is limited to when the database was last backed up. To find out which recovery model your database is using, run the following command, which should return either FULL, BULK_LOGGED, or SIMPLE: SELECT dbpropertyex("database", "recovery") To change the recovery option for a database, run this command: ALTER DATABASE database name SET RECOVERY {FULL | SIMPLE | BULK_LOGGED} In addition to data, SQL Server backups also contain the database schema and database metadata (e.g., database files, file groups, and their locations). SQL Server allows users to remain on the database while the backup occurs, so any transactions committed during the backup are recorded as part of the backup.







Talkback
Hello I am quite new to SQL server and when I try to run "SELECT dbpropertyex("database", "recovery")" against the Master Database I get the error: "Server: Msg 195, Level 15, State 10, Line 1
'dbpropertyex' is not a recognized function name."
Why is this and how can i get a listing of which recovery mode each of my databases are in?
USE the following, the above will not work.
SELECT [Name] AS DatabaseName, DatabasePropertyEx([Name],'recovery') AS RecoveryModel
from SysDatabases ORDER BY [Name]
SELECT DATABASEPROPERTYEX('tempdb','recovery')