Set Query Time-Out on SqlServer

greenspun.com : LUSENET : SQL Server Database Administration : One Thread

Hi

I need to set the query-time out on Sqlserver for few mins ex(15 mins).

I have found the option in SqlServer through EnterPriceManger In SqlServer Properties Connection tab, I found the default one as 600 sec. but the queries are still executing more than 600 sec. can you Please let me know the solution if I need to time out the Sql Query which should not execute more than the specified time (only by the options setting on the SqlServer).

Thank you Narendhar

-- Anonymous, January 12, 2005

Answers

Hi, u can us the system procedure . ie sp_configure 'Query Governer Cost limit', Value.

here value in seconds. after compleation of this u have to execute Reconfigure.

bye for now Reddyprasad.A DBA

-- Anonymous, January 13, 2005


Hi Reddy Prasad

Thanks for the response.its working out. I have observed that either the query stop first itself or it will exceute till it gives the result

ex: I have a table Borrower. Once I set the 'Query Governer Cost limit' on server for 5 sec, when I execute the query 'select * from borrower'. it cancel the query by giving a messge estimated cost of this query is more than the configure value.

after that I set the 'Query Governer Cost limit' to 9 sec. this time it got executed but taken 18 sec.

is it going to work this way or can I find an option for canceling this query once it crosses 9 sec's

Thank you Narendhar

-- Anonymous, January 13, 2005


Moderation questions? read the FAQ