Recently, I uninstalled the beta version of BizTalk 2009 Enterprise. I have to remove BizTalk SQL tables because they were not compatible with the development version, but when I try to remove BizTalkMsgBoxDb gives the following error:
TITLE: Microsoft SQL Server Management Studio
——————————
Drop failed for Database ‘BizTalkMsgBoxDb’. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.1600.22+((SQL_PreRelease).080709-1414+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+Database&LinkId=20476
——————————
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
——————————Cannot drop database “BizTalkMsgBoxDb” because it is currently in use. (Microsoft SQL Server, Error: 3702)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.1600&EvtSrc=MSSQLServer&EvtID=3702&LinkId=20476
——————————
📝 One-Minute Brief
When uninstalling or reconfiguring BizTalk Server, you may encounter an error stating: “Cannot drop database BizTalkMsgBoxDb because it is currently in use.” This happens because active connections from BizTalk Host Instances, SQL Agent jobs, or monitoring tools prevent the drop operation. To fix this, you must manually stop all BizTalk services, stop the SQL Agent, and—if necessary—use a SQL script to “kill” active processes or set the database to Single User mode before retrying the configuration.
Cause
This happens because active connections from BizTalk Host Instances, SQL Agent jobs, or monitoring tools prevent the drop operation.
SQL Server requires exclusive access to drop a database. If even one connection remains—whether from a forgotten Host Instance or a background monitoring tool—the operation will fail.
Solution
- I restarted the SQL server service, and it solved the problem.