June 29, 2011 at 10:06 am
For some of my databases I am creating an automated script for index maintenance and backups.
I have a script for backing up logs and the database but I was hoping to not need to save Recovery Model for the databases being backed up. What is the easiest method of getting Recovery Model from a DatabaseName information?
I have the database name so I can always retrieve the ID @dbID = db_ID(@dbname)
This is one method I was attempting but have not found the information.
EXECUTE sp_msforeachdb 'SELECT * FROM [?].sys.database_files'
Odds are I am missing something obvious.
thanks
Daryl
June 29, 2011 at 10:31 am
June 29, 2011 at 10:31 am
June 29, 2011 at 11:38 am
June 29, 2011 at 1:35 pm
Thank you all.
sys.databases looks like what the doctored ordered. Including information that will be useful for other areas.
June 30, 2011 at 2:39 am
SELECT DATABASEPROPERTYEX(DB_NAME(), 'Recovery')
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply