Problem with proc.kill()

C

cu.4m.srinivas

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??
 
Z

zacks

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top