SQL Stuff

Find The Recovery Model Of All Databases

Find the status of all your databases with this little script. This will show you the Recovery Model, State, and if the Databases is in Read Only mode.

use master;
set nocount on

‘database’ = db_name(database_id)
, ‘status’ = state_desc
, ‘recovery model’ = recovery_model_desc
, ‘ready only?’ = case is_read_only
when ‘0’ then ‘Nope’
when ‘1’ then ‘Yes’ end
db_name(database_id) not in ( ‘master’, ‘msdb’, ‘model’, ‘tempdb’ ) order by
db_name(database_id) asc


Categories: SQL Stuff

Tagged as: , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s