locked
Time Out Error RRS feed

  • Question

  • Hi,

    I am working on a large database for health organization and it has millions of records.it is integrated with ASP.NET web application.unfortunately when saving a large form the "Wait Operation Time Out" error was occurring. i have searched and found its the SQL Server error,so on solution i also found that the queries are taking so much and need to be optimized.SO i used the SQL Server tuning and performance tool by following its recommendation almost 100%.Luckily the error is occurring no more.I just need to confirm if it is a permanent solution or not? Also provide any better recommendations if you have.?

    Thanks

    Shahzad Ul hassan
    Monday, August 15, 2016 1:31 PM

Answers

  • Maybe. Maybe not. I am not making statements about a situation I know nothing about. Nor am I interested in being your alibi.

    What I can say is that there is no such error as "Wait Operation Time Out". But there three timeout errors that can occur when a query runs for a long time. The by far most common is "Timeout expired", although the exact message depends on the client API. This is not an SQL Server error, but it's a timeout that elapses in the client when the API has not seen any response from SQL Server within a certain timeframe. For most APIs this timeout is 30 seconds.

    The way to deal with these timeout depends. Sometimes it's a OK that a report that is only runs once a day runs for 60 seconds. In that case, the timeout is a pain in the rear parts, and the resolution is to change the timeout; for instance set it to 0 = wait forever.

    For other queries, 30 seconds is just insanely long time, and in this case, the correct action is query tuning.

    The second timeout you can get is a lock timeout, and this is an SQL Server error. The default here is -1, meaning wait forever. That is, you need to enable lock timeouts to get them.

    The third timeout you can get is when running a query against a linked server. This is actually the same thing as the query timeout above, but since your local SQL Server acts as client to the remote server, you get the error from your local instance this time. Also, the default this time is 10 minutes.

    Monday, August 15, 2016 2:19 PM
  • Hello,

    The default value of SqlCommand.CommandTimeout Property is 30 seconds; the developer could increase the value, but the better option is to optimize the used queries.


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Tuesday, August 16, 2016 5:39 PM

All replies

  • Maybe. Maybe not. I am not making statements about a situation I know nothing about. Nor am I interested in being your alibi.

    What I can say is that there is no such error as "Wait Operation Time Out". But there three timeout errors that can occur when a query runs for a long time. The by far most common is "Timeout expired", although the exact message depends on the client API. This is not an SQL Server error, but it's a timeout that elapses in the client when the API has not seen any response from SQL Server within a certain timeframe. For most APIs this timeout is 30 seconds.

    The way to deal with these timeout depends. Sometimes it's a OK that a report that is only runs once a day runs for 60 seconds. In that case, the timeout is a pain in the rear parts, and the resolution is to change the timeout; for instance set it to 0 = wait forever.

    For other queries, 30 seconds is just insanely long time, and in this case, the correct action is query tuning.

    The second timeout you can get is a lock timeout, and this is an SQL Server error. The default here is -1, meaning wait forever. That is, you need to enable lock timeouts to get them.

    The third timeout you can get is when running a query against a linked server. This is actually the same thing as the query timeout above, but since your local SQL Server acts as client to the remote server, you get the error from your local instance this time. Also, the default this time is 10 minutes.

    Monday, August 15, 2016 2:19 PM
  • Tuesday, August 16, 2016 9:00 AM
  • Hi,

    Here is the snapshot of the error maybe you can now provide more clear recommendations.

    Thanks
    Tuesday, August 16, 2016 9:01 AM
  • That is a query timeout. This means that all but the last two paragraphs in my previous post applies.

    Tuesday, August 16, 2016 12:11 PM
  • Ok! thanks a lot Erland
    Tuesday, August 16, 2016 2:50 PM
  • Hello,

    The default value of SqlCommand.CommandTimeout Property is 30 seconds; the developer could increase the value, but the better option is to optimize the used queries.


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Tuesday, August 16, 2016 5:39 PM