How to make database read only?


You can use the below script to make the database read only so that no user can edit the database.


USE [master]
GO
ALTER DATABASE [DBName] SET READ_ONLY WITH NO_WAIT
OR
GO
ALTER DATABASE [DBName] SET READ_ONLY
GO

Comments

2 responses to “How to make database read only?”

  1. kaushalpatel245 Avatar
    kaushalpatel245

    how to remove read only from some of the tables of my database in mysql ?

    i dont know how this happened !!

    help me to do solve as fast!!!!

    1. Jugal Shah Avatar

      You can revoke SELECT permission from the tables for that particular users.

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