SQL Server – Database Read Only
Here is simple script with you can set your database in Read-Only Mode
Once you specify database is in read-only mode then users can read data from the database, not modify it.
Here is Script :
Mark Database Read Only
USE [master] GO ALTER DATABASE database_name SET READ_ONLY WITH NO_WAIT
Similarly you can change database Read-Only Mode to Read-Write
Here is script :
Mark Data Read- Write Mode
USE [master] GO ALTER DATABASE database_name SET READ_WRITE WITH NO_WAIT GO
Alternative way
1. Click the Start button.
2. Select All Programs.
3. Navigate to the Microsoft SQL Server 2008 folder.
4. Right Click on database then click properties
5. In the Option under State drop down
6. Mark Database Read-Only – True
7. Click OK.