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.

Passing parameters to 'kill'

2 posts in Windows NT Last posting was on 1999-11-18 21:11:41.0Z
Alan Ramsay Posted on 1999-11-18 18:46:09.0Z
From: "Alan Ramsay" <alan@dotdash.org.uk>
Subject: Passing parameters to 'kill'
Date: Thu, 18 Nov 1999 18:46:09 -0000
Lines: 19
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2014.211
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
Message-ID: <NkU0mVfM$GA.288@forums.sybase.com>
Newsgroups: sybase.public.sqlserver.nt
NNTP-Posting-Host: da136d186.dialup.callnetuk.com 212.67.136.186
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:2959
Article PK: 1090394

Can anyone advise if it is possible to pass parameters to the kill command?

I would like to be able to script something to kill of all processes either
logged in with a specific user_name, or all process other than my own and
system processes.

Obviously I would like to do this without stopping and restarting the
server.

I have tried declaring a variable 'spid_to_kill', selecting a single spid
into it, and then doing a kill @spid_to_kill, but with no avail.

Any assistance greatly appreciated.

Thanks

Alan


Mark A. Parsons Posted on 1999-11-18 21:11:41.0Z
Message-ID: <38346B8D.D32EA31D@compuserve.com>
Date: Fri, 19 Nov 1999 10:11:41 +1300
From: "Mark A. Parsons" <iron_horse@compuserve.com>
Organization: Iron Horse, Inc.
X-Mailer: Mozilla 4.61 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Passing parameters to 'kill'
References: <NkU0mVfM$GA.288@forums.sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 17
NNTP-Posting-Host: p469.ipa1-n8-16.iconz.net.nz 210.48.25.213
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:2955
Article PK: 1090390


Alan Ramsay wrote:
>
> Can anyone advise if it is possible to pass parameters to the kill command?
>
> I would like to be able to script something to kill of all processes either
> logged in with a specific user_name, or all process other than my own and
> system processes.
>

Unless things have changed in version 12 ... the 'kill' command will not
take a variable.

Either do this in your client application (C, C++, VB, shell script,
etc.) code ... or you may be able to do it via the sp_remotesql 'stuff'
(hint: setup your local server to look like a 'remote' server).

--
Mark Parsons
Iron Horse Consulting, Ltd.