check for database properties on all databases

  • Hi,

    i want to write a script the check all my databases if some properties is not configure right.

    few example - check if compatibilty_level 0 and etc...

    i want to run it on all databases (cursor ) and get the error for every database with the wrong properties.

    can syntax with case will work?

    THX

  • I just wonder, depending on the properties you're looking for can't you just query master.sys.databases?

    It contains a column for almost any database property, incl compatibility level.

    Another approach would be using sp_MSForeachDb. And if you want to raise an error you should use IF instead of CASE.

    [font="Verdana"]Markus Bohse[/font]

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

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