Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save benmccallum/7c9a4b61097ec759aa5d to your computer and use it in GitHub Desktop.
Save benmccallum/7c9a4b61097ec759aa5d to your computer and use it in GitHub Desktop.
MSSQL Server - Kill all processes on a DB
USE master;
GO
ALTER DATABASE AdventureWorks
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
ALTER DATABASE AdventureWorks
SET MULTI_USER;
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment