Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Single User Check

Status
Not open for further replies.

benvegiard

Programmer
May 15, 2003
63
US
Hi All,

What's the easiest way to see if a database is currently in SINGLE_USER or MULTI-USER mode?

I tried sp_dboption, and it shows "Single User" as a value, but does not indicate if it's on or off. The DB's I tried it on are known to be in Multi-User mode (or, at least, they are accepting multiple users for read and write)

Thanks,
Ben
 
Code:
--SQL 2000
SELECT DATABASEPROPERTYEX('mydb', 'UserAccess')

--SQL 7
SELECT DATABASEPROPERTY('mydb', 'IsSingleUser')

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top