Have you read the article on sys.databases in Books Online? You really should. 🙂
Anyway, here's the query:
select[name]
,state_desc
fromsys.databases
...or if you want a 1 for every database in recovery, and a 0 for every other state:
select[name]
,is_inrecovery
= case[state]
when2
then1
else0
end
fromsys.databases
ML
---
Matija Lah, SQL Server MVP
http://milambda.blogspot.com