I need to know how to interrogate a Microsoft SQL Server, to see if a given database has been set to Read-Only
or not.
Is that possible, using T-SQL?
The information is stored in sys.databases
.
SELECT name, is_read_only
FROM sys.databases
WHERE name = 'MyDBNAme'
GO
--returns 1 in is_read_only when database is set to read-only mode.