How can I check what mode a particular database is in?
+2
A:
use sp_dboption like this
EXEC sp_dboption 'DB_NAME', 'single user'
to set it add the option third parameter. See below
Preet Sangha
2010-10-12 10:56:18
Does that not set it? I want to report back on it's current state (because I am not convinced setting it to multi_user has worked.)
Toby
2010-10-12 10:57:02
no its for read and write.
Preet Sangha
2010-10-12 11:05:16
I did not know that, thought you could only set things with it, thanks for the answer but as you say in another comment, there is a quicker way.
Toby
2010-10-12 11:09:37
+2
A:
try using the DATABASEPROPERTYEX
SELECT DATABASEPROPERTYEX('databasename','UserAccess')
if the database is in multi_user mode must return MULTI_USER
RRUZ
2010-10-12 11:01:29