Collections:
SINGLE_USER/MULTI_USER - Database User Access Options in SQL Server
How to set database to be SINGLE_USER in SQL Server?
✍: FYIcenter.com
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
⇒ System Databases Used by SQL Servers in SQL Server
⇐ READ_ONLY/READ_WRITE - Database Update Options in SQL Server
2016-11-20, 1334🔥, 0💬
Popular Posts:
How to run Queries with SQL Server Management Studio Express in SQL Server? 1. Launch and connect SQ...
How To Create a Stored Program Unit in Oracle? If you want to create a stored program unit, you can ...
What Are the Underflow and Overflow Behaviors on FLOAT Literals in SQL Server Transact-SQL? If you e...
How to download Microsoft SQL Server 2005 Express Edition in SQL Server? Microsoft SQL Server 2005 E...
How To Verify a User name with SQLCMD Tool in SQL Server? The quickest way to verify a user name in ...