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.
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.
B. Using SQL query:
ALTER DATABASE [TechCartNow] SET READ_WRITE
Result:
.NET Professional | Microsoft Certified Professional | DZone’s Most Valuable Blogger | Web Developer | Author | Blogger
Doctorate in Computer Science and Engineering
Microsoft Certified Professional (MCP) with over 12+ years of software industry experience including development, implementation & deployment of applications in the .NET framework
Experienced and skilled Agile Developer with a strong record of excellent teamwork, successful coding & project management. Specialises in problem identification and proposal of alternative solutions. Provided knowledge and individual mentoring to team members as needed
Among top 3% overall in terms of contribution on Stack Overflow (~2.3 million people reached my posts). Part of the top 1% Stack Overflow answerers in ASP.NET technology.
DZone’s Most Valuable Blogger (MVB)
Created and actively maintain the TechCartNow.com tech blog while also editing, writing, and researching topics for publication.
Excellent skills in Application Development using C#/Vb.Net, .NET Framework, ASP.NET, MVC, ADO.NET, WCF, WPF, Web API, SQL Server, jQuery, Angular, React, BackboneJS
Helpful!!
Thanks.
Thanks. I have used this a few times. Very usefull
Helpful!!!
I get an error : Unable to open the physical file, access denied
that is because you might not have the correct permissions to properly access the files in question.
ok good read only for database
how to read only for table
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.
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?