Without taking into account your timeout;
Are you using the sql management console to run your query? If so, when connected to the database there is a parameter button that allows you to set timeouts.
Alternatively, if in the query window, right-click and select Query Options ....
0 means unlimited, I would check it. 4 minutes is a long time, maybe the request can be reorganized to speed up?
If you run this inside Visual Studio via C #, the default timeout is 30 seconds. Change it by setting the command timeout:
SqlCommand comm= new SqlCommand(); comm.CommandTimeout = 300;
Jon raynor
source share