SQL Server Performance

script to check the recovery model

Discussion in 'General DBA Questions' started by dba_boston, Mar 18, 2008.

  1. dba_boston Member

    Is there script I could check the recovery model for sql server?
    I have over 100 database on each server, and I would like to check and set the recovery model for each database for simple model.
    It is very time consuming to check each one by right click and choose properties?
    Thanks for your help.
  2. ndinakar Member

    You can check recover_model from sys.databases.
  3. KGautney New Member

    Did you ever get an answer on this one?
  4. suniljk7 New Member

    This is what u are looking for?? like this you can find all properties of all database.
    SELECT name, databasepropertyex (name,'Recovery'),
    FROM master..sysdatabases
    Thanks
    John
  5. Idris Chambas New Member

    SELECT name, DATABASEPROPERTYEX(name, 'Recovery')
    FROM master.dbo.sysdatabases
    ORDER BY 1

    Alternatively,
    SELECT name, recovery_model, recovery_model_desc
    FROM master.sys.databases
    order by 1
  6. Luis Martin Moderator

    Hi Idris, welcome to the forums!

    Thanks for share your expertise.
    Try to check thread date. This one is 2 years old.:)
  7. Idris Chambas New Member

    Thanks Luis.
  8. preethi Member

    Hi Idris,
    Welcome to the forums,
    You are not bad. A few days back I answered to a thread which was 8 years old. :eek: Faithful moderators like Frank and Luis are there to point out it when we do it.
    Please continue to share your knowledge.
  9. Luis Martin Moderator

    Hi Idris,
    May be my lack of English sound aggressive.
    I'm sorry about that.:(
  10. Idris Chambas New Member

    No offence at all Luis and your english is absolutely perfect. No need to apologise, Luis.
    Frankly, I have a lot to learn from both you and Preethi, and will continue to learn from your immense contributions to this great resource you share freely to enhance the development of others.

    My reason for adding to the 2year thread was due to a comma error (typo) I felt should be corrected to help others to this great resource which may has gone unnoticed since 2008.

    However, your time, effort and contributions are greatly appreciated by all who thrive to enrich and share their knowledge of SQL Server. You are the eyes and ears of all users.

    Thanks for having me on board.
  11. satya Moderator

    Posting a solution to the old questions is not a problem at all, over the time the practices do get change.. unless there is no advertisement or spam in the response ONE is always welcome to dust off the old thread :)

Share This Page