1Select name from sysdatabases where status2 & 48 0
2go

name

—————-

testdb

(1 row affected)

Read the rest