Is that 10 seconds before the first row is returned, or until all rows are
returned?  What version of SQL Server, what service pack?

If you are building the query in the SP, the optimizer may have preselected
a non-optimal execution plan for the final query.  Try viewing the execution
plan for executing the procedure with the execution plan for the query in
QA.  That may give you a clue.

HTH,
Tore. 

-----Original Message-----
From: Steve Abaffy [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 3:23 PM
To: ActiveServerPages
Subject: OT: SQL Query runs way faster in Query Window then as Stored
Procedure


Hello,

I was just wondering if anybody knew why the exact same piece of SQL would
run faster in the Query Analyzer window than it does as a stored procdure. I
mean in the query window it takes 10 seconds and as a stored procedure it
takes 9 minutes and 21 seconds????? Any help in this are would be greatly
appreciated.



---
You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%

---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to