Ms Sql Server Error 3906
Contents |
SERVER - Error: Fix for Error Msg 3906 - Failed to update database because the database is read-only February 10, 2015Pinal DaveSQL, SQL Server, SQL
Failed To Update Database Because The Database Is Read-only Sql Server
Tips and Tricks18 commentsSome error messages are a great source failed to update database because the database is read-only alwayson of troubleshooting when things go wrong. I always request my blog readers to read what
Failed To Update .mdf Database Because The Database Is Read-only
the error messages are conveying. Most of the solutions are very much documented as part of the message. I must agree that over the years failed to update database because the database is read-only visual studio the error messages have become more descriptive in SQL Server.On a similar note, recently one of the DB’s sent me a mail stating they were getting the below error message and they thought I had something on the blogs to help them solve the same.Msg 3906, Level 16, State 1, Line failed to update database because the database is read-only localdb 10Failed to update database "ProdDB" because the database is read-only.On careful search, I haven’t seem to have written about the resolution. When I looked at the error message, I thought it was quite explanatory and didn’t need any mention about solution. Your database is marked as ReadOnly and we are not able to write into them. So why the fuss, just mark your database as read-write.After that incident, I thought of writing this blog to show how this can be solved with a simple code. Let us get into the script next. Let us create our database for testing. CREATE DATABASE [ReaOnlyDB] CONTAINMENT = NONE
ON PRIMARY
( NAME = N'ReaOnlyDB', FILENAME = N'C:\Temp\ReaOnlyDB.mdf' , SIZE = 5120KB , FILEGROWTH = 1024KB )
LOG
360 games PC games
Failed To Update Database Because The Database Is Read Only Sharepoint
Windows games Windows phone games Entertainment All Entertainment failed to update database because the database is read-only c# Movies & TV Music Business & Education Business Students & educators
Failed To Update Database Because The Database Is Read Only Availability Group
Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet http://blog.sqlauthority.com/2015/02/10/sql-server-error-fix-for-error-msg-3906-failed-to-update-database-because-the-database-is-read-only/ Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All https://support.microsoft.com/en-us/kb/3069154 Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
Read-Only state as shown in below image : To change your database to Read-Write state ,execute below code: ALTER DATABASE [AdventureWorks2012] http://www.allaboutmssql.com/2012/10/sql-server-2012-database-read-only.html SET READ_WRITE To change your database to Read-Only state ,execute below code: ALTER DATABASE [AdventureWorks2012] SET READ_ONLY You can also Set Database Read - Only state to TRUE/FALSE through SSMS 2012 ,Under Object Explorer, right-click on your Database - > Properties - > State - > Database Read - Only - > True/False failed to as shown in below image : If your database is in Read - Only state , you cannot make any changes to your database : USE [AdventureWorks2012]ALTER DATABASE [AdventureWorks2012] SET READ_ONLY WITH NO_WAITCREATE TABLE TEST (col1 int) Msg 3906, Level 16, State 1, Line 5Failed to update database "AdventureWorks2012" because the database is read-only. failed to update Posted by Sathyanarrayanan S at Thursday, October 11, 2012 Reactions: Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: Administration No comments: Post a Comment Newer Post Older Post Home Subscribe to: Post Comments (Atom) Translate Pages Home T-SQL Scripts SQL Server - (XML,XQUERY,XPATH) SQL Server Integration Services SQL Server Reporting Services SQL Server - Extended Events Powershell SQL Server - Handling JSON data My TechNet Wiki Articles and TechNet Gallery Scripts SQL Server Analysis Services SQL Server Management Studio (SSMS) SQL Server Data Quality Services Microsoft Excel , Powerpoint and Power BI SQL Server - Policy Based Management SQL Server Errors List SQL Server - Favourites Microsoft Azure - SQL Server My posts on Other blog/sites About Me Blog Archive ► 2016 (10) ► January (10) ► 2015 (26) ► December (23) ► November (3) ► 2014 (11) ► August (3) ► July (1) ► February (2) ► January (5) ► 2013 (125) ► December (7) ► November