MSSQL Cannot drop database because it is currently in use

USE Master; 
GO
  
ALTER DATABASE AnnoyingDb SET SINGLE_USER WITH ROLLBACK IMMEDIATE 
GO
 
-- and finally 
DROP DATABASE AnnoyingDb; 
GO

Comments