Home All Groups Group Topic Archive Search About

Problem with proc.kill()

Author
27 Sep 2006 9:14 AM
cu.4m.srinivas@gmail.com
Hi,

My case is, i am trying to kill a process (SQLPLUS process) in my Win.
Service, when either the Service is stopped or when my app exe is
killed from the Task Manager.

The problem is, when i kill the SQL process, its not getting killed,
and its running and running.
I find this in both the cases of stopping the service and killing the
exe.

What can i do to kill the process, because killing  SQLPLUS is
critical; and because of this problem, two SQLPLUS processes are
overlapping with each other, when the next time i start the
exe/service. Thus, my output file, where actually i spool data (using
SQLPLUS) becomes inconsistent and this is bad.

I couldn't find any alternative to proc.kill() [which shd. actually
kill the process immediately]

Can any of u help me out in this ASAP??

Author
27 Sep 2006 12:26 PM
zacks
cu.4m.srini***@gmail.com wrote:
Show quote
> Hi,
>
> My case is, i am trying to kill a process (SQLPLUS process) in my Win.
> Service, when either the Service is stopped or when my app exe is
> killed from the Task Manager.
>
> The problem is, when i kill the SQL process, its not getting killed,
> and its running and running.
> I find this in both the cases of stopping the service and killing the
> exe.
>
> What can i do to kill the process, because killing  SQLPLUS is
> critical; and because of this problem, two SQLPLUS processes are
> overlapping with each other, when the next time i start the
> exe/service. Thus, my output file, where actually i spool data (using
> SQLPLUS) becomes inconsistent and this is bad.
>
> I couldn't find any alternative to proc.kill() [which shd. actually
> kill the process immediately]
>
> Can any of u help me out in this ASAP??

You question is a little ambiguous, but I am assuming by SQL process
you mean a process running on the SQL Server and shows up in a Query
Analyzer window when you run the sp_who command. I have successfully
killed such processes by simply running a SQLCommand with "kill <spid>"
as the command text.

AddThis Social Bookmark Button