Skip to content

Instantly share code, notes, and snippets.

@ignas-sakalauskas
Last active April 17, 2017 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ignas-sakalauskas/33bec463973ad5ab242b57759bc169ba to your computer and use it in GitHub Desktop.
Save ignas-sakalauskas/33bec463973ad5ab242b57759bc169ba to your computer and use it in GitHub Desktop.
Force drop database when in use
USE master
ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DROP DATABASE YourDatabaseName
-- https://ignas.me/tech/force-drop-database-when-in-use/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment