SQL query always times out and has expired

Source: Internet
Author: User
Tags sql server driver odbc sql server driver

The SQL query always times out and expires. In WIN8, the system prompts: OLE DB or ODBC error: Query timeout has expired; HYT00

1. SQL database timeout due to database design issues:
Microsoft ole db Provider for SQL Server Error '80040e31' ([odbc SQL Server Driver] timeout expired );
CPU and memory usage is low on the server;
The Event Log prompts: * files in the database '*' are automatically increased after 453 milliseconds. Use alter database to set a smaller FILEGROWTH or a new size.
Cause:
When the database is set, [file growth] increases by percentage. When the database file is large (more than 1 GB), a timeout is reported for the new operation, at this time, the CPU and memory usage are very low. Solution:
Set the above file growth here to a lower percentage or directly specify how many megabytes are added. 2. SQL Server database timeout settings
Modify the connection timeout settings of the client. By default, the timeout setting for registering another SQL Server through the Enterprise Manager is 4 seconds, and the query analyzer is 15 seconds. Settings in Enterprise Manager:
In Enterprise Manager, select "Tools" from the menu and then "options ";
In the displayed "SQL Server Enterprise Manager properties" window, click the "advanced" tab;
Enter a large number, such as 30, in the "Login timeout (seconds)" box on the right under "connection settings.
Query settings in Analyzer:
Click "Tools"-> "options"-> "connection"; Set logon timeout to a large number, and set connection timeout to 0. 3. analyze the cause of timeout when querying a statement:
Query timeout generally involves finding the cause from the structure of SQL statements and data tables. Optimizing SQL statements and creating indexes for database query fields is the most common method.
In addition, the database query timeout settings are generally maintained by sqlserver (before you modify the query wait configuration), only when the actual query time exceeds the estimated query time by 25 times, will time out.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.