July 2, 2007 at 8:10 pm
one of the script that is written in VB is running fine in one server and when the same job is run on different server, it is throwing timeout expired error as follows,
Unhandled Exception:
System.Data.Sqlclient.SqlException:
Timeout expired.The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated. at
System.Data.Sqlclient.SqlConnection.OnError(SqlException exception, Boolean break connection)
at System.Data.Sqlclient.SqlInternalConnection.OnError(SqlException exception, Boolean break connection)
and so on......
When the Update script is run on query analyzer, it is taking 48 seconds. And the remote query timeout on the SQL Server Instance is 600Seconds.
What should be changed?
Any help is greatly appreciated.
July 2, 2007 at 10:55 pm
Are you able to connect your SQL server from the remote machine using sqlcmd or SSMS. Check for them and let us know.
Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
July 2, 2007 at 11:08 pm
Check that the Remote query timeout on the slower server has the same value with the one in the server that your query performs better (right clisk on instance name -> Connections ->Remote query timeout).
Next would be to run a sp_updatestats on the slower instance. Check here if all needed statistics are created (you could run DTA for your query). However, sql 2005 is a bit dainty with statistics.
Hope this helps.
July 3, 2007 at 8:34 am
Slower server has the same value 600 secs as in the other server where the query is performing well.
I'll try the update stats and let you know.
Can you also let me know how does update stats effects timeout error?
July 3, 2007 at 10:24 am
Can anyone confirm that, Do I need to change both SQLCommand.CommandTimeout property in C#.NET code and also Connection String in the Web.config file?
July 4, 2007 at 7:12 am
If you are sure the default values of those are less than the sql defaults then you canchange that to reflect it with sql and have that advantage.
Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply