This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13788|Reply: 0

[Source] SQL Server Attached Database is displayed as read-only when the workaround

[Copy link]
Posted on 9/11/2017 10:02:47 AM | | | |
I won't say much about the long-winded words, let's get straight to the point!

Option 1:

In this situation, the SA account is generally used to log in, as long as it is changed to Windows authentication, and then the database can be attached.

Option 2:

Use sa to log in to SQL Server 2008 to attach the database, after attaching the database is read-only, then click on the database --> "Properties" --> "Options" --> "Status", and find that the item "Database is read-only" is true, change it to false, if you can modify it, then congratulations, your character is good! I reported this error again when I was modifying:



In this case, find your data files and log files, right-click on "Properties" -> "Security", add a "Network Service" account, and give the account full control. Login again with sa, attach database, hehe... You will find that life is so beautiful!!

Title: Microsoft SQL Server Management Studio
------------------------------

Change for database "xxx" failed.  (Microsoft.SqlServer.Smo)

For help information, please click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.2100.60+((SQL11_RTM).120210-1917+)&EvtSrc= Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Change+Database&LinkId=20476

------------------------------
Additional information:

An exception occurred when executing a Transact-SQL statement or batch processing. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Unable to open the physical file "D:\SqlData\xxx.mdf". OS error 5: "5 (Access denied. )”。
Unable to open the physical file "D:\SqlData\xxx_log.ldf". OS error 5: "5 (Access denied. )”。
Database "xxx" cannot be restarted. will revert to the previous state.
ALTER DATABASE statement failed. (Microsoft SQL Server, Error: 5120)

For help information, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.2100&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476

------------------------------
Button:

Are you sure
------------------------------


The above operation did not solve my problem.My workaround is to set Users to full control of the database folder, solved! The database version is 2012




Previous:.Net code security protection product DNGuard HVM is used
Next:C# TextBox search input box with hint descriptions
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com