sql-server – How to Drop a Database Snapshot After a Failed SQL Server Upgrade

sql serversql server 2014

I'm dealing with an issue where database snapshots cannot be dropped after SQL Server has been upgraded to 2014. The snapshots are defunct but cannot be dropped.

Now although the Connect item has a disappointing comment in it I assume that this will be fixed eventually. However, I need to deal with this soon.

Is there a way to drop a database snapshot that cannot be deleted due to this bug? I fear that I have exhausted all documented means to do this. It might take undocumented modifications to system tables. Is there a way to force a database (snapshot) to be dropped?

Best Answer

I was able to reproduce this in an Azure VM, and resolve by simply setting the primary database offline and dropping the snapshot, eg

ALTER DATABASE AdventureWorks2012 SET OFFLINE
DROP DATABASE AdventureWorks2012_SN001