
Execute the below command to enable the Microsoft SQL Server database for Read Only or Read/Write state.

Read Only
ALTER database THE-DATABASE-INSTANCE SET READ_ONLY;
Read/Write
ALTER database THE-DATABASE-INSTANCE SET READ_WRITE;
You can also perform the same activity using the SQL Server Management Studio. Right click on the database instance and go for Properties.
You can get change the setting from the Option page.



