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