简体   繁体   中英

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

SP is RecordSource of the form. When form is opened SP executed and after a time-out of query, connection is closing with nothing. If SP executed from SSMS it performed for about 2 seconds and returns a set of records. 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. Help me, I'm confused. Screen with profiler http://take.ms/u7tTy

@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? Understanding Performance Mysteries

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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