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

Posted on 2014-07-15
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:dmaclean2
    LVL 4

    Accepted Solution

    LVL 20

    Assisted Solution

    by:Marten Rune
    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

    Thank you both. Good set of answers

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now