Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't delete database snapshot SQL Server, Error: 946

I need to drop a snapshot of a database using SQL Server 2014 (in order to drop the database itself). When I attempt to drop the database...

EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N'xxx'
GO

USE [master]
GO

DROP DATABASE [xxx]
GO

I get the following error...

Drop failed for Database 'xxx'. (Microsoft.SqlServer.Smo)

ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Cannot open database 'xxx' version 706. Upgrade the database to the latest version. (Microsoft SQL Server, Error: 946)

https://drive.google.com/file/d/0B3S2sioQNnAwSEs1RmN6UDJ2N0U/view?usp=sharing

Could this be a result of a connection that needs to be closed?

like image 942
Brendan Lesinski Avatar asked Jul 25 '26 18:07

Brendan Lesinski


1 Answers

I found the solution to this problem. I simply needed to execute the below statements.

    ALTER DATABASE [Your DB Here] SET OFFLINE
    Drop database [Your DB snapshot here] 
like image 174
Brendan Lesinski Avatar answered Jul 27 '26 09:07

Brendan Lesinski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!