Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wanted to physically move the files associated with a database in SQLServer 2005 Express. I backed up the database, detached the database, copied the files to a different drive, and then reattached. When I reattached I changed the filename at the top half of the screen, but didn't notice that the filename used in the bottom half of the screen (for the individual files) had the old filename.

Since then whenever I've started up the server and the SQLServer service I get a message saying that it is recovering, even an hour later.

I would like to detach the database, but I can't do that. I can stop SQLServer and rename the files, but then it just gives an error message about not finding the files.

There are messages in the application log Process 51:0:0 (0xe94) Worker 0x03A800E8 appears to be non-yielding on Scheduler 0. Thread creation time: 12897060171040. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 0%%. System Idle 98%%. Interval: 1750921 ms.

How do I get rid of my database entry in the management studio so I can either reattach it properly, or restore from backup?

share|improve this question

Paul Randal has an excellent blog post on recovering a database by setting it into Emergency Mode and using CHECKDB with the REPAIR_ALLOW_DATA_LOSS option. After you recover the database hopefully you can drop and restore it from the backup correctly.

Hope this helps

share|improve this answer
+1 for link to Paul Randal's page. This really is the worst case scenario, though. – user3914 Sep 11 '09 at 13:23
I think mine is worse! Paul's method doesn't work. I can't stop it from recovering. My workaround is restore to a different database and then use that in my application. – paulmorriss Sep 11 '09 at 14:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.