How to KIll a Stored procedure invoked by UNIX?

Hi,

I am using sql server 2008 version and invoking the stored procedure using unix script. I want to know the procedure of killing the stored procedure in sql server.
If I kill -9 the unix script will it also terminate the process at the SQL server. When I executed the kill -9 PID in unix and ran the command exec sp_who2 it showed me only one sessionid and status as runnable - which means waiting for resources. BUt I am not sure whether it was the one which was triggered through unix.
My SP is executing in loop thereby is there any way I can avoid going into infinite loop?
Thanks in advance!

What's the parent PID of the stored procedure's process? Should be the calling process' PID.

Hi Rudi,

I checked the PID's using the PS command in unix and based on the PID of the SQLCMD used the command

KILL -9 PID 

.

Not sure if this will kill the session in the sql server as well.