DATABASEPROPERTYEX - recoverymodel

  • I have a few databases. Some a 2005 and some are 2000. I have a query that I run to get the recoverymodel of my 2005 databases seen below..

    select name, recovery_model, recovery_model_desc from master.sys.databases

    While trying to get that information from my 2000 databases I went into the object explorer window in SSMS >> Master >> System Tables >> dbo.sysdatabases....

    I did not see recoverymodel anywhere but if I run this... found using google, i get what i want.

    select name, databasepropertyex(name, 'Recovery') as RecoveryModel from master.dbo.sysdatabases order by name

    So I guess my question is this...

    When writing these queries how are you to know what to select to get what information? Is this just a hidden field that I can't veiw? Where is it pulling this from and why can't I see it when browsing?

  • Oh I see. It's a built in function where you specify what property of the function you want to run on a specified database.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply