How to Change a Database To Single User Mode or Multi User Mode

Change the Database From Multi User Mode to Single User Mode:




Change the Database From Single User Mode to Multi User Mode:

Chnage the Database To Single User Mode or Multi User Mode by Using T-SQL:
--How to put Database in single user mode
USE [master]
GO
ALTER DATABASE [Demo] SET  SINGLE_USER WITH  rollback Immediate
GO
--How to put Database in multi user mode
USE [master]
GO
ALTER DATABASE [Demo] SET  MULTI_USER WITH NO_WAIT
GO
Comments