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 and holds a master's degree in Systems Engineering. Chrissy is also certified in SQL Server, Linux, SharePoint and network security. You can follow her on Twitter at @cl.

Posted in SQL Server

Leave a Reply

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

*