Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Stop a blocked SQL stored procedure from C#

Author  Topic 

tchinedu
Yak Posting Veteran

71 Posts

Posted - 2011-12-22 : 18:49:55
I need to cancel Stored procedures from client app.

In some instances, the stored procedures might be blocked and taking a while.

Questions.

1. SqlCommand.Cancel() - if I call this on the command object, will it stop the stored procedure in sql server 2008

2. If the stored procedure process is currently blocked, will SqlCommand.Cancel also kill the process

3. I assume both scenarios will return the connection object to the connection pool

Please advice if there's an alternative way to achieve the desired result.
   

- Advertisement -