Thread and Stored Procedure

Worrow

Regular
Joined
Jul 10, 2003
Messages
68
So I started a new thread in my C# application to run a stored procedure. Since it takes a long time to run, I want to let the user cancel this operation while the stored procedure is still running. My question is if I stop this thread, will the stored procedure (which run on a Sql2005 server) stop about the same time, or keep on going? In my case, I would like to stop that as well. Any suggestion? Thanks in advance.
 
Just found out there is a function under Sqlcommand called 'cancel'... Now I have another question. If I called trans.Commit right after sqlcmd.cancel, would this actually update whatever the stored procedure has done before the cancel command or doing nothing?
 
Back
Top