Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 query time out

Author  Topic 

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2007-11-21 : 06:49:41
hi,

how can i define a simple time-out exceed when running a simple select query like

select a from atable where a > 1

and define if query doesn't give results in 5 sec, it should be stopped.

Hommer
Aged Yak Warrior

808 Posts

Posted - 2007-11-21 : 08:50:34
I am sure you have simplified your case.

In the ado world, you have this command and connection objects, and both of them has a timeout property that you can set to certain threshhold.

In sql2005, SQL-DMO gives you some capability in this regard as well.

In a netshell, you need two threads, one for the query and another for keeping the time, checking the result, and kill the first thread under the set condition.

This is more of a task for dot net app. I am not sure if and how t-sql handle it.
Go to Top of Page

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2007-11-21 : 11:09:03
i'm in sql2005 world :) t-sql :)

i know that ado have nice solutions for this. but for SQL-DMO, i'm clueless.
Go to Top of Page
   

- Advertisement -