SQL data query, slow in the program, fast in Ms SQL2005 Management Studio, situation analysis and resolution

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

These two days encounter a problem in the. NET developed Web site, execute SQL queries, monitor the card from SQL Profiler to see, execution time 22s.

But the copied SQL is executed directly in Management Studio with a time of only 4ms.

The solution is as follows, adding "SET ARITHABORT on;" in the SQL statement.

Solution Resolution:

The default ARITHABORT for SQL Server Management Studio is set to ON.The client application sets ARITHABORT to OFF to receive different query plans, making it difficult to troubleshoot poorly performing queries. that is, the same query can be executed quickly in Management Studio, but it is slower in the application. always match client ARITHABORT settings when troubleshooting query failures using Management Studio.

SQL data query, slow in the program, fast in Ms SQL2005 Management Studio, situation analysis and resolution

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.