SQL Script to disconnect users from a database
USE master;
GO
ALTER DATABASE N”
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
GO
ALTER DATABASE N”
SET READ_ONLY;
GO
ALTER DATABASE N”
SET MULTI_USER;
GO
SQL Script to disconnect users from a database
USE master;
GO
ALTER DATABASE N”
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
GO
ALTER DATABASE N”
SET READ_ONLY;
GO
ALTER DATABASE N”
SET MULTI_USER;
GO