Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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