The following exception is thrown:
Error Message: Microsoft.SqlServer.Management.Smo.FailedOperationException: Drop failed 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 drop database "4d982a46-58cb-4ddb-8999-28bd5bb900c7" because it is currently in use.
Any idea what caused this?
Is it possible to call a SMO function to finalize any running Transact-SQL statements?