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
 SQL Server Administration (2008)
 Cancel a blocked SQL stored procedure from C#

Author  Topic 

tchinedu
Yak Posting Veteran

71 Posts

Posted - 2011-12-24 : 12:11:53
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.

Even though the existence of God cannot be determined through reason, a person should wager as though God exists, because living life accordingly has everything to gain, and nothing to lose - Pascal Blaise

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-24 : 12:42:35
duplicate of

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=169493

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -