Link to home
Start Free TrialLog in
Avatar of VBRocks
VBRocksFlag for United States of America

asked on

Failed to update database ... because the database is read-only

Hi, thanks for clicking...

I have 2 computers:

My primary computer is a desktop with Windows XP on it, which has SQL Server 2005 Developer Edition on it.  This computer has a SQL database on it that I want to copy to my secondary computer, so I can run the Database Enging Tuning Advisor on it, then I want to copy it back to this computer.  (Because the Database Enging Tuning Advisor on this computer won't work).

My secondary computer is a laptop with Windows Vista on it, it also has SQL Server 2005 Developer Edition on it.  

On my primary computer, I stopped SQL Server (MSSQLSERVER), and copied the dabase to a flash drive.

On my secondary computer, I plugged the flash drive in, copied the database to my harddrive, opened SQL Server, and tried to Attach the database.  When I do, I get an error that says "Failed to update database ... because the database is read-only".  It does attach it, but it is ReadOnly.

My question is, how can I get the database attached properly so it is ReadWrite?

Then my plans are to run the Database Engine Tuning Advisor on it, then copy it back to my primary computer.

Thanks again for your help.
Avatar of Ashley Bryant
Ashley Bryant
Flag of United States of America image

Call me crazy, but did you check the .mdf file to make sure it isn't read only?
ASKER CERTIFIED SOLUTION
Avatar of Ashley Bryant
Ashley Bryant
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The best way to do is to detach the database and than copy the files instead of stopping the services.

Once detached copy the mdf and ldf files and then do an attach onto the another server.

You can also take a backup to a file and copy that .bak file onto your vista laptop and restore the db on your vista laptop.

Hope this helps

cheers.