Msg 3702, Level 16, State 3, Line 2
Cannot drop database “DataBaseName” because it is currently in use.
This is a very generic error when DROP Database is command is executed and the database is not dropped. The common mistake user is kept the connection open with this database and trying to drop the database.
The following commands will raise above error:
USE AdventureWorks; GO DROP DATABASE AdventureWorks; GO
Fix/Workaround/Solution:
The following commands will not raise an error and successfully drop the database:
USE Master; GO DROP DATABASE AdventureWorks; GO
If you want to drop the database use master database first and then drop the database.
Reference : Pinal Dave (https://blog.sqlauthority.com)
63 Comments. Leave new
Thanks…it’s work fine
Thanks, Pinal – worked for me.
close sql server management studio > open sql server management studio > database >right click delete :)
Great Zeeshan.
ok. this worked good.Thanks.
Thanks @Mai Duc Anh
it works fine
Glad to hear that @Bassa
USE MASTER;
DROP DATABASE dummyDB;
This does not work for me .
I get the following error:
Error: Cannot drop database “dummyDB” because it is currently in use.
SQLState: S0004
ErrorCode: 3702
There might be some other users connected to the Database. You need to terminate all such connections
Instead this worked for me
USE master;
ALTER DATABASE SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DROP DATABASE ;
I am trying to drop database using these commands but it’s gives same error.
I also check whether this database used in any running commands but this is not used currently.
So i am trying to drop database it’s gives same error again and again.
can you suggest how to resolve this msg 3702 error massage.?
There might be some other users connected to the Database. You need to terminate all such connections
Use This Command Below and try it again if you get the same error.
USE [master]
GO
ALTER DATABASE [DB NAME] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
DROP DATABASE [DB NAME]
GO
Who told you that ??????????