Saturday, June 19, 2010

Error 3702 Cannot Drop Database Because It Is Currently In Use

While running below query I am getting error.

USE AdventureWorks;
GO
DROP DATABASE AdventureWorks; 
GO 

ERROR:
Msg 3702, Level 16, State 3, Line 2
Cannot drop database “AdventureWorks” because it is currently in use. 

Workaround / Solution:
Step 1: Check if any open transactions through SP_Who2 

Step 2: If any active connections then kill. 

Step 3: Use below script for doping the AdventureWorks database instead of above script, use master database first and then drop the database. 
USE MASTER;
GO
DROP DATABASE AdventureWorks; 
GO


Cannot drop database because it is currently in use, Cannot drop database “DataBaseName” because it is currently in use. Cannot drop database "MyDatabaseName" because it is currently in use. "Cannot drop database because it is currently in use". How to force drop database. Problem Dropping Database. Cannot drop database “DbName” because it is currently in use. how to drop database which is in use.

0 comments:

Post a Comment