Set SQL Server to prohibit execution of SQL statements that take a long time

Source: Internet
Author: User
Tags management studio sql server management studio

 

Because the version of a maintained project cannot be affected, many developers have experienced it, especially as the table data volume increases, so the performance of some SQL statements is getting worse and worse. In this way, as the number of visits increases, it puts a lot of pressure on the database.

 

In order to quickly reduce the pressure on the database and check the quality of SQL statements in the future, only the SQL statements that are banned for execution for more than 200 milliseconds are set in the database, after the SQL statement execution time is configured, the pressure on the database is reduced a lot.

 

However, this is only a temporary solution to improve performance at the cost of temporarily sacrificing some features. Therefore, we need to consider the time needed. However, this setting is good for checking the performance of SQL statements written later.

 

The setting method is as follows:

 

In the Enterprise Manager (SQL Server Management studio express:

Root directory-> right-click Properties-> connection-> use the query controller to prevent long-running queries. Check this item and enter the maximum execution time in the text box below.

Note that the unit is ms. We recommend that you set it to 200 ms, but this is determined by the hardware strength and access pressure of each project.

 

Below (the English version of SQL Server 20005 and the Chinese version of 2005 ):

 

Right-click to select connection

 

 

Configuration details (English Version SQL Server 2005)

 

 

Configuration details (Chinese Version SQL Server 2005)

Related Article

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.