How do you stop, take offline, and delete a SQL Server database in recovery?
- 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.
- Right click on the database in SQL Server Management Studio, and hit Detach.
- Select the Drop Connections checkbox only, and hit ok.
- Then the database will disappear.
- Right click on the Databases folder, and click Attach...
- Click Add and find the .mdf file for the database you deleted. You will have to find it in the file system.
- Click Ok, and it will be back online.