Tuesday, March 27, 2012

Abort a long running query

Hi
I would like to have a long running query aborted by SQL server, such that,
that query does not become a resource Hog and I can catch that in my client
side code and display a nice error message to the user.
Any way I could do that?
I am sorry if this is being posted in the wrong forum
--
MattISTS wrote:
> Hi
> I would like to have a long running query aborted by SQL server,
> such that, that query does not become a resource Hog and I can catch
> that in my client side code and display a nice error message to the
> user.
> Any way I could do that?
> I am sorry if this is being posted in the wrong forum
You can set a query timeout from your client code and roll the
transaction back if you hit the timeout. But that can only be done on
the client. From the server, you can use the SET
QUERY_GOVERNOR_COST_LIMIT server option to limit queries from runnning
that are too costly.
--
David Gugick
Quest Software
www.imceda.com
www.quest.com

No comments:

Post a Comment