Kill all sessions in single database

Categories: SQL Server
USE master;
GO

ALTER DATABASE <DatabaseName>
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;

ALTER DATABASE <DatabaseName>
SET MULTI_USER;
GO
«
»

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.