Reputation:
Specifically I'd like to detect when a query has been executing for over 5 minutes and then cause it to rollback, I could no doubt do this at an application level but am investigating if SQL Server has any built in mechanism to do this for me.
Note, for clarification, I'm sadly still running SQL Server 2000.
Upvotes: 0
Views: 461
Reputation: 34523
In the discussion of this question How do I set a SQL Server script’s timeout from within the script? I have found reference to There's no such thing as a query timeout... article which says what "query timeouts are a client-side concept only".
You could consider using
SET QUERY_GOVERNOR_COST_LIMIT value
command, but unfortunately it isn't exactly what are you looking for.
As documentation says it disallows execution of any query that has an estimated elapsed time, in seconds, required to complete the query on a specific hardware configuration.
Upvotes: 1
Reputation: 2523
In SQL Server Management Studio, goto Tools > Options > Query Execution.
Upvotes: 1