Checking if SQL Server database is running in MULTI_USER mode
Ho开发者_运维技巧w can I check what mode a particular database is in?
try using the DATABASEPROPERTYEX
SELECT DATABASEPROPERTYEX('databasename','UserAccess')
if the database is in multi_user mode must return MULTI_USER
use sp_dboption like this
EXEC sp_dboption 'DB_NAME', 'single user'
to set it add the option third parameter. See below
精彩评论