While running below query I am getting error.
USE AdventureWorks;
GO
DROP DATABASE AdventureWorks;
GO
ERROR:
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
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.
Step 1: Check if any open transactions through SP_Who2
Workaround / Solution:
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








