Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Is there a SQL command I can run to determine the recovery model of my database? I want to know if its full recovery or not.

share|improve this question
add comment

3 Answers

up vote 11 down vote accepted

Some variety in how to do it...

SELECT D.recovery_model_desc FROM sys.databases D WHERE name = 'MyDB'

or

SELECT name, D.recovery_model_desc FROM sys.databases D

or

SELECT DATABASEPROPERTYEX('MyDB', 'Recovery')
share|improve this answer
add comment

Here's a script i made to show me database file paths and recovery models:

SELECT 
  A.recovery_model_desc AS [Recovery Model], 
  A.name AS [Database Name], 
  C.physical_name AS [Filename], 
  CAST(C.size * 8 / 1024.00 AS DECIMAL(10,2)) AS [Size in MB], 
  C.state_desc AS [Database State]
FROM sys.databases A
INNER JOIN sys.master_files C ON A.database_id = C.database_id
ORDER BY [Recovery Model], [Database Name], [Filename]
share|improve this answer
add comment

This Query gives you the list of databases with only Simple recovery model;

SELECT name, DATABASEPROPERTYEX(name, 'Recovery') as Recovery_Model
FROM sys.databases
WHERE DATABASEPROPERTYEX(name, 'Recovery') = 'Simple'
ORDER BY name;
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.