Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Disconnecting all users

Author  Topic 

simondeutsch
Aged Yak Warrior

547 Posts

Posted - 2001-12-30 : 23:10:56
Hiya!
How do I, in SQL Server 7, disconnect all users at once from my database (I need to do some maintenance work)? BOL seems to say the only way to do this simply is to stop service on the server. If you have e.g. 30 users using KILL is not practical. Also, if possible, stick to T-SQL that can be run in ISQL,OSQL,or Query Analyzer. No SQL-DMO,E-SQL please.

Thanks,
Sarah

izaltsman
A custom title

1139 Posts

Posted - 2001-12-30 : 23:24:19
I am afraid you have to use Kill (in SQL2k you have other options)... But in SQL7 you simply need a proc to do the killing for you. Here is what I use:

http://www.swynk.com/friends/knight/killusers.asp

Go to Top of Page

VyasKN
SQL Server MVP & SQLTeam MVY

313 Posts

Posted - 2001-12-31 : 03:20:29
Here is a better script that I created. The procedure is called sp_dboption2 and it simulates the new commands of SQL2K, in SQL7.
http://vyaskn.tripod.com/administration_faq.htm#q16

--
HTH,
Vyas
Check out my SQL Server site @
http://vyaskn.tripod.com
Go to Top of Page
   

- Advertisement -