Skip to content

Instantly share code, notes, and snippets.

@farukaf
Created August 2, 2021 17:28
Show Gist options
  • Save farukaf/4eb86f144fbf10ddc0940459fe3396d9 to your computer and use it in GitHub Desktop.
Save farukaf/4eb86f144fbf10ddc0940459fe3396d9 to your computer and use it in GitHub Desktop.
Switch SQL Server SingleUser/MultiUser to cut open connections
USE DBNAME
GO
ALTER DATABASE DBNAME SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE DBNAME SET MULTI_USER WITH ROLLBACK IMMEDIATE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment