SINGLE_USER/MULTI_USER - Database User Access Options in SQL Server
How to set database to be SINGLE_USER in SQL Server?
Databases in SQL Server have three user access options:
You can use the "ALTER DATABASE" to change database user access options as shown in the tutorial below:
USE FyiCenterComData GO ALTER DATABASE FyiCentercomData SET SINGLE_USER GO
Now connect to server with another client session and try:
USE FyiCenterComData GO Msg 924, Level 14, State 1, Line 1 Database 'FyiCenterComData' is already open and can only have one user at a time.
Go back to the first session and re-set the database to MULTI_USER:
ALTER DATABASE FyiCenterComData SET MULTI_USER GO
2016-11-20, 445👍, 0💬
Where to find answers to frequently asked questions on Storage Engines: MyISAM, InnoDB and BDB in My...
How To Import One Table Back from a Dump File in Oracle? If you only want to import one table back t...
How To Enter Unicode Character String Literals in SQL Server Transact-SQL? Unicode characters are mu...
How To Use "IF ... ELSE IF ..." Statement Structures in SQL Server Transact-SQL? "IF ... ELSE IF ......
How To Generate Random Numbers with the RAND() Function in SQL Server Transact-SQL? Random numbers a...