Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more: , +
Hi,

I have set timeout of SQL COMMAND to 2 minutes for one of the SP of search.but if that SP can not return result within 2 minutes then execution of that SP will continue or stop.

Please let me know.
Thanks
Posted

1 solution

All TSQL calls operate within an implicit transaction.

In .net if a SqlCommand times out it will ROLLBACK the implicit transaction.

So your stored procedure will be terminated and rollback.

Your only option is to set your CommandTimeout to say 3*60 seconds for example.
 
Share this answer
 
Comments
Pravinjas 29-Sep-11 2:22am    
Thanks. Can we stop execution of that stored procedure explicitly
Mehdi Gholam 29-Sep-11 2:34am    
Yes, you can call the cmd.Cancel() on your SqlCommand object.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900