Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Store procedure slower than script

Status
Not open for further replies.

almirjr

Programmer
Mar 14, 2003
2
BR
Hi,

I have a store procedure wich takes more than 1 min. to process. But if I declare the variables as the parameters specifications and run it as a script in query analyser, it tooks less than 5 seg.s.

well, the sql-script is the same, the variables used at sql-script are the same....

what can be the difference so that it took more time to process a sp than a script ?

where can i start to invistage ?

Thanks, Almir.
 
go into query analyser, select "Show Server Trace" from the query menu.

Run both the stored procedure and the code within the stored procedure from query analyser. Check the "Trace" tab after each execution. This will summarize where execution time is spent. This will be a start to finding where the discrepancy comes from.

Cheyney
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top