[Last Call] Learn how to a build a cloud-first strategyRegister Now


SQL Server 2012 - How to stop a Restore that never completes

Posted on 2014-07-15
Medium Priority
Last Modified: 2014-07-19
A few days ago I was doing some DB restores on my test server. In the course of the restore of one database, call it Gen1, somehow got messed up. The normal restore (from device) was closed, but the Object Explorer pane continued to say Gen1 (Restoring...). I closed SSMS and went on to other things. Today when I started SSMS, it still says Gen1 (Restoring...).

If I try to take it offline, it says I cannot. Detach is unavailable. I Stopped SQL Server, deleted the .mdf and .ldf and restarted SQL Server. Opened SSMS again. Still says Gen1 (Restoring...)

What do I need to do to get SQL Server to just give up on that restore task?
Question by:Douglass MacLean

Accepted Solution

Philip Portnoy earned 1000 total points
ID: 40199785
LVL 20

Assisted Solution

by:Marten Rune
Marten Rune earned 1000 total points
ID: 40201102
Since you deleted the files, you'll need to issue:
drop database nameofdb;

now do your restore again, and make sure the above commented with recovery is selected.

Regards Marten

Author Closing Comment

by:Douglass MacLean
ID: 40205975
Thank you both. Good set of answers

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question