简体   繁体   English

从MS SQL SERVER和MS ACCESS调用存储过程的结果之间的差异

[英]Difference between results of calls stored procedure from MS SQL SERVER and MS ACCESS

SP is RecordSource of the form. SP是窗体的RecordSource。 When form is opened SP executed and after a time-out of query, connection is closing with nothing. 打开窗体时,将执行SP,并且在查询超时后,连接将关闭而没有任何响应。 If SP executed from SSMS it performed for about 2 seconds and returns a set of records. 如果从SSMS执行SP,它将执行约2秒钟并返回一组记录。 As I watched through the SSMS Profiler calls are identical, but count of Reads value (an execute from Access) > 28 million, and about 70 thousand from the SSMS. 正如我所看到的,SSMS Profiler调用是相同的,但是Reads值(来自Access的执行)计数> 2800万,而来自SSMS的计数约为7万。 Help me, I'm confused. 帮帮我,我很困惑。 Screen with profiler http://take.ms/u7tTy 屏幕与探查器http://take.ms/u7tTy

@tobypls, @tobypls,
thank you very much - your link was helpful. 非常感谢您-您的链接很有帮助。
Simple solution is rewrite (for example) 简单的解决方案是重写(例如)

from

ALTER PROCEDURE [dbo].[sproc] 
@param1 int,  
AS  
SELECT * FROM Table WHERE ID = @param1  

to

ALTER PROCEDURE [dbo].[sproc] 
@param1 int,
AS
DECLARE @param1a int
SET @param1a = @param1
SELECT * FROM Table WHERE ID = @param1a  

I get it from this post . 我从这篇文章中得到了它。

But if you need full understanding of trouble then you must read really great article 但是,如果您需要对麻烦有充分的了解,那么您必须阅读非常出色的文章
Slow in the Application, Fast in SSMS? 应用速度慢,SSMS快速吗? Understanding Performance Mysteries 了解性能奥秘

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM