Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sa execlusive use
Message
From
10/04/2002 18:08:03
 
 
To
10/04/2002 11:16:18
General information
Forum:
Microsoft SQL Server
Category:
Database management
Miscellaneous
Thread ID:
00643221
Message ID:
00643518
Views:
9
>> How can I know how many current users for the database?

When you connect to a database, SQL Server aquires a shared lock on the database so that it can keep track of which connections are using which database.

Execute sp_lock and look at the results. You should see a shared locks (MODE=S) for the database (TYPE=DB) and the dbid.

>> How can I don't let users access this database?

Take a look at sp_dboption. Specifically the "single user" or "dbo use only" options. You're probably most interested in "dbo use only."

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform