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]