How can we disable all active users in SQL Server 2005 Express using sql

How to disconnect all active users in SQL Server 2005 Express using sql

+4
source share
2 answers

Just run this sql query:

USE [master] GO ALTER DATABASE MyDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE; RESTORE DATABASE MyDB FROM DISK = 'backupfile path' WITH REPLACE 
+1
source
 USE [master] GO ALTER DATABASE [YourDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO Your Restore Statement ALTER DATABASE [YourDB] SET MULTI_USER GO 
0
source

Source: https://habr.com/ru/post/1301442/


All Articles