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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Query and stored procedure

Author  Topic 

Makkaramestari
Starting Member

8 Posts

Posted - 2008-03-14 : 08:36:00
Hello!

I run a query in Query Analyzer and it takes 4 sec. Then I run exactly the same query in stored procedure also in Query Analyzer and it takes over five minutes. Can anyone tell me why?

Makkaramestari

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-03-14 : 08:40:12
Cache?
What happens second time you run the code with SP?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Makkaramestari
Starting Member

8 Posts

Posted - 2008-03-14 : 08:52:44
Hi!

Actually, the query is much faster, when run first time. The order of the queries has no effect on the running times. The "straight" query is always seconds, same query through procedure minutes, every time.

Makkaramestari
Go to Top of Page
   

- Advertisement -