There are times when you want to kill all the current active connections of your SQL Server database and you wish to run the database in the single user instance.
Here’s the query on how to do this.
ALTER DATABASE <NameoftheDatabase> SET SINGLE_USER WITH ROLLBACK IMMEDIATE
Once done with any changes , ensure that the MULTI_USER mode is enabled for the database.
ALTER DATABASE <NameoftheDatabase> SET MULTI_USER
Enter your email address to subscribe to this blog and receive notifications of new posts by email.