Make SQL Server DB Read Only/Read-Write Only

Read Only
You can add the database in readonly mode by using below query. You can not add, update or delete any records once database is in read only mode.

ALTER DATABASE SQLDBPOOL set READ_ONLY
GO

READ_WRITE
You can set the database again in to Read/Write mode using below query.

ALTER DATABASE SQLDBPOOL SET READ_WRITE WITH NO_WAIT
GO

Comments

5 responses to “Make SQL Server DB Read Only/Read-Write Only”

  1. sushil Avatar
    sushil

    its not workin for me..

    1. Jugal Shah Avatar

      what error you are getting?

  2. P.V.Rajagopal Avatar
    P.V.Rajagopal

    Thank you for you information

  3. Amir Ali Avatar
    Amir Ali

    Small Correction: ALTER DATABASE XXX SET READ_WRITE WITH NO_WAIT

Thanks for the comment, will get back to you soon… Jugal Shah