November 17, 2007 at 12:14 pm
After successfully detaching the database, I tried to reattach the same database to the same instance that it was detached from and I received this error.
Cannot attach a database that was being restored. (Microsoft SQL Server, Error: 1824)
Can someone please help?
November 17, 2007 at 1:02 pm
Hi,
Check the following post http://www.sqlservercentral.com/Forums/Topic358239-146-1.aspx
Regards,
Ahmed
November 19, 2007 at 2:15 am
are you trying to attach with the same name or different?
Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
November 19, 2007 at 7:19 am
Same name. Actually it was for practice. I detached the database and immediately tried to reattach to the same SQL Server instance. I don't know what I did wrong. I read the solution from the last reply. That didn't seem related to what I was experiencing.
Any help would be appreciated.
November 19, 2007 at 7:29 am
Does the database appear in SSMS?
November 19, 2007 at 11:03 am
No.
November 19, 2007 at 3:37 pm
The database is in a read only state. Did you restore the database and use the norecovery or standby options, or you backup the tail of the transaction log prior to detaching the database? If so, the database will be placed in a restoring state. This will cause a problem when you try to attach the database because SQL cannot take it out of a read only state.
Try restoring the database from a backup then detach and reattach.
November 19, 2007 at 3:54 pm
Thanks.
November 20, 2007 at 4:31 am
I've had problems before in 2k5 where using the GUI to attach the DB wasn't working properly and while the database showed as attached, the sys.databases table didn't know it existed.
I ended up having to use the Create Database...For Attach command to get it to attach properly. You might try this with the REBUILD_Log option to see if you can get the DB attached without restoring from a backup.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply