Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Query takes for every when run in a stored proc

Author  Topic 

sqlnovice123
Constraint Violating Yak Guru

262 Posts

Posted - 2006-03-17 : 16:31:06
Hello,

When I run the SQL statements piece by piece, the execution time under 10 seconds. The stored proc takes forever.

All I am doing is retrieving (10,000+) rows of data using temp tables and joins. I have indexed each of the temp table.

What could be the reason for the slowness?

Thanks in advance!!!
sqlnovice123

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-03-17 : 18:01:33
We'll need to see the code in order to help.

Tara Kizer
aka tduggan
Go to Top of Page

DustinMichaels
Constraint Violating Yak Guru

464 Posts

Posted - 2006-03-17 : 19:34:22
Its because you have a syntax error on line 300 of your script.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-03-17 : 20:35:53
quote:
Originally posted by DustinMichaels

Its because you have a syntax error on line 300 of your script.


Wow ! how do you know this without looking at the code ?



KH

Choice is an illusion, created between those with power, and those without.
Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant

Go to Top of Page

SreenivasBora
Posting Yak Master

164 Posts

Posted - 2006-03-19 : 20:59:02
If you have chance, start sql profiler to trace which statement is causing the prob while executing the store proc. Any chance pl. check the execution plan of sp.

With Regards
BSR
Go to Top of Page
   

- Advertisement -