The following exception is thrown:
Error message: Microsoft.SqlServer.Management.Smo.FailedOperationException: Failure error for database "4d982a46-58cb-4ddb-8999-28bd5bb900c7". ---> Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: Cannot delete database "4d982a46-58cb-4ddb-8999-28bd5bb900c7" because it is currently in use.
Any idea what caused this?
Is it possible to call the SMO function to complete any running Transact-SQL statements?
source
share