SQL Tips #5 - Listing the recovery model for each database


Saturday, 16 July 2016

Share with: 
 

How many times have you wanted to the check the recovery model configured for each of your databases, and clicked through their properties individually? I Know I have done this too many times.

This query simply dumps the recovery model setting for each database.

How it works

The query is very simple - it just extracts the settings from sys.databases.

The Query


SELECT name AS dbname,recovery_model_desc AS recoverymodel FROM sys.databases

The output

A list of databases and their recovery model is returned.

dbname      recoverymodel
master	    SIMPLE
tempdb	    SIMPLE
model	    FULL
msdb	    SIMPLE

Disclaimer

These queries are provided as a guide, and are by no means perfect. I use these on Microsoft SQL Server 2012, 2014 and 2016.

Tags

SQL, Programming
Useful SQL tips - how to list the SQL Recovery Model of all your databases
 
 

Popular Articles

What is Kutamo?
Kilimanjaro 2015
Exploring Lync and IoT
Exchange 2013 in 60 minutes
Monitoring Lync with MRTG
Lync UCWA Tutorial - Introduction
Tutorial Parts 1 | 2 | 3 | 4 | 5

Recent Articles

Australian Postal Codes
Skype Web SDK
Using the Skype Web SDK from any language or framework
Building a Skype for Business Auto Responder using the Skype Web SDK
Exporting Lync or Skype for Business Contacts with the Skype Web SDK

Favourite Links

Kutamo
Telco Together Foundation
Cloud on Kilimanjaro

Tags / Keywords

SQL, Programming