Question : How can I kill process in SQL.

Hi, Experts.
I have SP that runs 30 seconds. I need to terminate the process of this SP after the ADO connection timeout is expired (for example: I have 15 seconds timeout for ADO Connection and the SP runs 30 seconds. After the connection timeout is expired the SP continue to execute, and it is hard for the Server.)
I need to Kill the process and the connection (if still exists) after the ADO connection timeout is expired.
I know that the "sp_who" stored procedure and "KILL" method can help me but I need some working example.

Thanks,
RRR.

Answer : How can I kill process in SQL.

I disagree. If there is no solution to a question, then that doesn't mean that you should not accept comments that give you the "best case" alternatives.

If you ask a question "Is it possible to climb Mt Everest in an hour?" and the answer is "No, but you could do it in 36 hours" then that doesn't mean there is no acceptable answer just because the answer is no.

There is no way to do what you were asking. I supplied the only alternative possibilities which was a manual solution as opposed to an automatic solution. I also covered the points relating how to try and stop the situation rising in the first place (prevention is better than cure).

Sorry that the "answers" were not what you were hoping for, but I'm afraid that's life :)
Random Solutions  
 
programming4us programming4us