How to drop a SQL database stuck in Restoring…

No idea where I got this (it’s been in Drafts forever), and now I kinda want to do it in PowerShell, but here’s some T-SQL to drop a hella stuck database (if plain old restore database @dbname doesn’t work).

Chrissy is a Cloud and Datacenter Management & Data Platform MVP who has worked in IT for over 20 years. She is the creator of the popular SQL PowerShell module dbatools, holds a master's degree in Systems Engineering and is coauthor of Learn dbatools in a Month of Lunches. Chrissy is certified in SQL Server, Linux, SharePoint and network security. You can follow her on Twitter at @cl.

Posted in SQL Server
One comment on “How to drop a SQL database stuck in Restoring…
  1. Rich says:

    saved me, here in 2019
    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

*