SQL Server/T-SQL Tutorial/System Functions/DATABASEPROPERTY
SELECT DATABASEPROPERTY("mydb", "IsReadOnly")
4> SELECT DATABASEPROPERTY("mydb", "IsReadOnly")
5> GO
-----------
NULL
(1 rows affected)
4> SELECT DATABASEPROPERTY("mydb", "IsReadOnly")
5> GO
-----------
NULL
(1 rows affected)