Monday, May 3, 2010

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

No comments:

Post a Comment