How to kill all connection of a databases in sql server ?

–Set your Database in single user mode

ALTER DATABASE yourDBName
SET SINGLE_USER WITH ROLLBACK IMMEDIATE

—Again Set  your database in Multi user Mode

ALTER DATABASE yourDBName
SET MULTI_USER;

Leave a Reply

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