Checking the health of the SQL Server database in MULTI_USER mode

How can I check in what mode the particular database is in?

+3
source share
2 answers

try using DATABASEPROPERTYEX

SELECT DATABASEPROPERTYEX('databasename','UserAccess')

if the database is in multi_user mode, should return MULTI_USER

+7
source

use sp_dboption like this

EXEC sp_dboption 'DB_NAME', 'single user'

to set it, add the third parameter parameter. See below

alt text

+2
source

Source: https://habr.com/ru/post/1769115/


All Articles