How to change database from Read-Only to Read-Write mode in SQL SERVER ?

Recently, I was working on new ASP.NET application and for that I attach an existing database to SQL SERVER. I noticed that it gets attached in read-only mode.

database read only

So, to change database to Read-Write mode, I need to follow any of the below steps:

A. Using SQL SERVER Management Studio:

Right click on Database, select Properties. And in the Database Properties window, select Options page. In Options page, under State change Database Read Only value to False.

sql server database read only

B. Using SQL query:

ALTER DATABASE [TechCartNow] SET READ_WRITE

Result:

database read write

 

 

You may also like...

8 Responses

  1. Ruchi says:

    Helpful!!

    Thanks.

  2. Ian says:

    Thanks. I have used this a few times. Very usefull

  3. Baskar Rajagopal says:

    Helpful!!!

  4. Knarf says:

    I get an error : Unable to open the physical file, access denied

  5. solomon says:

    ok good read only for database
    how to read only for table

  6. Jan de Groot says:

    Hello,
    Thanks for the explanation, but both ways (via properties and via sql query) didn’t work.
    Although the statement DATABASE READ-Only is on false, I still can’t write to it.
    Below the state in the propertie box it state’s DATABASE READ ONLY.

    The table is also linked in a MSAccess database, and from there we need to be able to write in the table.

    The table has accidentily been deleted, and been put back from a back up server.
    As far as I can See al rights are ok, and the ODBC connection from wich we connect to it from the accesss database is also working fine.

    What else can make a database read only?

    Thanks in advance.

  7. Jan de Groot says:

    Thanks for the Explanation, but for me it didn’t work.
    If tried the sql query and changing the propertie’s of the database.

    Under state the DATABASE REAN-Only was already false, but still it read DATABASE READ ONLY below in the propertie box.

    This database is also as a linked table in a msaccess database and from there we need to write into the table.
    This database has accedentially been deleted and put back from a back up server.

    As far as I can see al rights for the user are ok, and the ODBC connection wich we use to acces the datbase from from msaccess is working fine (tested)

    in msaccess it says the database is read only. In SQl I’m able to delete a row. So it isn’t read only.

    How is it possible that MS access sees the database as read only?

Leave a Reply

Your email address will not be published. Required fields are marked *