40

I have a development database which has entered recovery mode on restart, and has been recovering for the last hour or so.

I need to either stop the recovery, or kill it in some way.

I don't care one bit about the database or any of the data, I have deployment scripts.

Any ideas?

Philᵀᴹ
  • 31,952
  • 10
  • 86
  • 108

2 Answers2

56
  • Stop SQL Server
  • Delete MDF + LDF
  • Start SQL Server
  • Restore (may need to drop first, comes up suspect)

If the MDF and LDF are present on service start up, it will go into rollforward/rollback recovery. You have to drop them to prevent this.

gbn
  • 70,237
  • 8
  • 167
  • 244
8
  1. Right click on the database in SQL Server Management Studio, and hit Detach.
  2. Select the Drop Connections checkbox only, and hit ok.
  3. Then the database will disappear.
  4. Right click on the Databases folder, and click Attach...
  5. Click Add and find the .mdf file for the database you deleted. You will have to find it in the file system.
  6. Click Ok, and it will be back online.
adamoaragato
  • 81
  • 1
  • 1