- There's a deadlock somewhere with a SQL table on the database
- The database's statistics and/or query plan cache are incorrect
- The query is too complex and needs to be tuned
- The default timeout in the page codebase it too short and needs to be increased
2. The second issue will cause the database to use a sub-optimal query plan. It can be resolved by clearing the statistics:
If that doesn't work you could also try
Note: You should not do this when your server is under heavy load because it will temporarily incur a big performance hit as all stored procedures and queries are recompiled when first executed.
3. Execute the query being called in the page on SQL Server Management Studio (SSMS) and note the time to retrieve all results. Optimize the SQL query to reduce the amount of time taken to parse and return all data.
4. Update the affected page codebase to specify a long timeout value in the SQL call. The default timeout is normally 30 seconds. For example:
For more information on using the SQL command timeout, please review the following article from Microsoft. CommandTimeout Property
// Setting the command timeout to 2 minutes scGetruntotals.CommandTimeout = 120;
Note: We provide links to third-party websites in an effort to help you resolve your issue. We are not responsible for the information on third-party websites, and we cannot assist with implementing the resolution from these websites.