views:

29

answers:

3

How can we dis-connect all the active users on sql-server 2005 express using sql

+1  A: 

Just fire this sql query:

USE [master] 
GO

 ALTER DATABASE MyDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE; RESTORE DATABASE MyDB FROM DISK = 'backupfile path' WITH REPLACE
HotTester
A: 
USE [master]
GO
ALTER DATABASE [YourDB] SET  SINGLE_USER WITH ROLLBACK IMMEDIATE
GO

Your Restore Statement

ALTER DATABASE [YourDB] SET  MULTI_USER
GO
Doogie