Wednesday, March 7, 2012

Query Timout

Hi All,
I am fairly new to SQLServer, although I have used other RDBMS software
extensively.
Is there a simple way to restrict the amount of time a query runs for?
I have inherited a system that allows users to run very large queries and
it is killing performance. I want to time the query out after a given
number of second.
TIA
PeterPeter,
serverside you could look at setting the query governor cost limit using
sp_configure (see BOL). It will disallow 'costly' queries from starting so
isn't exactly what you are referring to but you might still find it useful.
On the client side, the sqlcommand object (or its equivalent in your
programming language) should have a query timeout property.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com|||"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in news:ODiQnZ$fGHA.5104
@.TK2MSFTNGP04.phx.gbl:

>
Thanks Paul,
I'll use this as a work around. We do not have the source for the
application unfortunately.
Peter

No comments:

Post a Comment