Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Kill Users

3 posts in Windows NT Last posting was on 2001-04-26 16:24:16.0Z
Scott Posted on 2001-04-26 13:43:12.0Z
From: Scott
Date: Thu, 26 Apr 2001 09:43:12 -0400
Newsgroups: sybase.public.sqlserver.nt
Subject: Kill Users
Message-ID: <418F5E8865F91F08004B5DF685256A3A.004B5E0485256A3A@webforums>
Lines: 5
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub sybase.public.sqlserver.nt:877
Article PK: 1087484

Does anyone have a stored procedure that will kill all users that are
connected to a specific database? Or something similar that I can modify?

Thanks
Scott


David Kerber Posted on 2001-04-26 13:56:15.0Z
Message-ID: <3AE828FF.24C8162C@ids.net>
Date: Thu, 26 Apr 2001 09:56:15 -0400
From: David Kerber <ns_dkerber@ids.net>
X-Mailer: Mozilla 4.75 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Kill Users
References: <418F5E8865F91F08004B5DF685256A3A.004B5E0485256A3A@webforums>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 19
NNTP-Posting-Host: host253.111.41.216.conversent.net 216.41.111.253
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:876
Article PK: 1087482

I think you'll need to connect a remotely-controlled gun to each user's
system to do this, or maybe electrify their keyboards <G,D&RVVF>.

Scott wrote:
>
> Does anyone have a stored procedure that will kill all users that are
> connected to a specific database? Or something similar that I can modify?
>
> Thanks
> Scott

--

Dave Kerber
Edit the return address by removing the ns_ before e-mailing

REAL programmers write self-modifying code, leading to:
Why there is ALWAYS one more bug (courtesy of O.D. Williams):
1. Debuging code is always much harder than writing it.
2. Therefore, if your code is as clever as you are capable of making
it, you are, by definition, inadequate to debug it.


Jon Posted on 2001-04-26 16:24:16.0Z
Message-ID: <3AE84BB0.1EBF6977@alleghany.co.k>
Date: Thu, 26 Apr 2001 17:24:16 +0100
From: Jon <jonathan.meads@alleghany.co.k>
Organization: Alleghany underwrting Ltd
X-Mailer: Mozilla 4.72 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Kill Users
References: <418F5E8865F91F08004B5DF685256A3A.004B5E0485256A3A@webforums>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 17
NNTP-Posting-Host: lolgate.lloyds.uk.ibm.net 195.212.5.4
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:875
Article PK: 1087483

two stage proccess, use a batch file to kick off an isql session and then use
its output, ie

create file called killusers.sql with the following line in it
select 'kill ' + spid + char(13) + char(10) + 'go' + char(13) + char(10) from
sysprocesses
go

then

isql -Ubob -Sserver -ikillusers -okilluserslist.sql
isql -Ubob -Sserver -ikilluserlist.sql

should do the trick, the char(13) etc are line feeds...


Cheers
Jon

Scott wrote:

> Does anyone have a stored procedure that will kill all users that are
> connected to a specific database? Or something similar that I can modify?
>
> Thanks
> Scott