Re: Estimate the Time for SQL query Execution

Tech-Archive recommends: Fix windows errors by optimizing your registry



In message <#cjlF3lSFHA.1176@xxxxxxxxxxxxxxxxxxxx>, Saradhi <upadrasta@xxxxxxxxxx> writes
Is there any way to estimate the time required to execute a T-SQL statement?
I need to set the command time out by calculating the time for T-SQL
statement. Can any one give an example?

You're probably better asking in somewhere like microsoft.public.sqlserver.programming.


Having said that, it depends on too many factors for it to be a particularly useful thing to do, in my opinion. What hardware will it run on, how busy will the server be at the time, how many records will there be in the tables, etc.

The decision on timeout has less to do with how long the command takes to execute and more to do with your system requirements; how long is the user willing to wait? Is it essential that the operation completes however long it takes? Is running it asynchronously an option?

--
Steve Walker
.