Switching database SQLSERVER single-user and multi-user mode

Sometimes the database at the time of occupation, want to do some operations can not be operated. Database may attempt to switch to single-user mode is operated. Switch back to multi-user mode after completing the operation.

Command is as follows:

alter database database name set Single_user - Single User
alter database database name set multi_user - Multi-User

or

sp_dboption database name, "single user", true - Single User

sp_dboption database name, "single user", false - Multi-User

If you use ALTER DATABAS or use SP_DBOPTION have no way to change to a multi-user or single-user mode
solution is
in the Activity Monitor process and, related to the purpose of the library KILL off, then refresh.
Use
ALTER DATABASE DB_TYZ modify just fine

Original Address: https://www.cnblogs.com/xdoudou/p/3733505.html

Guess you like

Origin www.cnblogs.com/binlyzhuo/p/11712279.html