Monday, March 19, 2012

how to detach a read only database from Sql Express

Need help

I made a mistake an attached a read only database to the server (now it is grey marked).

When I try to select this read only database in the MS SQL Server Management Studio, the server hangs up.

I removed the read only attribute from the .mdf and .ldf File and made a reboot of the server. Still the same problem.

How can I detach this read only database or how can I set the attribute to read/write (always hangs up the server, when I try to access this db)

I tried also:

alter database readOnly_dbname set read_write

or

USE master;
GO
EXEC sp_dboption 'readOnly_dbname', 'read only', 'FALSE';

Many thanks for an answer.

Kusi

Did you use sp_detachdb 'DbName' ?


Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

I have the same problem. In management studio, the only thing that you can do is to make delete on the read-only database. You will have an error, but the database will be well released from SQL Server. I didn't find a way to make it back non read-only... by scripting or in the management studio.

Someone has a solution for that problem?

|||

I found a solution. The issue is related to the files security.

Be sure that the .mdf and .ldf files have the NETWORK SERVICE and the SQLServer2005MSSQLUser$YourPc$YourSqlInstanceName security users with Full Control permission checked on them.

No comments:

Post a Comment