I need to know how to interrogate my Microsoft SQL Server to know if a given database has been set to read only or not. Is that possible?
+5
A:
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.
p.campbell
2010-05-28 15:26:19
Perfect! THANKS!!!
Giuseppe
2010-05-31 07:19:56