Search

Wednesday, April 10, 2013

Kill all users and set single user mode

USE master;
 GO
 ALTER DATABASE AdventureWorksLT2008R2
 SET SINGLE_USER
 WITH ROLLBACK IMMEDIATE;
 GO
 ALTER DATABASE AdventureWorksLT2008R2
 SET MULTI_USER;
 GO

No comments:

Post a Comment