Guru's .NET Blog
Wednesday, November 25, 2015
How to resolve "Cannot drop database because it is currently in use" error
Run a ALTER DATABASE command like below before dropping the database:
USE [master]
GO
ALTER DATABASE [databaseName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
USE [master]
GO
DROP DATABASE [databaseName]
GO
No comments:
Post a Comment
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment