Re: Stored Procedure executes very slow, code pasted into query-analyzer executes fast?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Simon (nospam_at_nospam.nospam)
Date: 03/01/04


Date: Mon, 1 Mar 2004 15:56:38 -0500

Try to recompile the procedure using sp_recompile

"Roji. P. Thomas" <lazydragon@nowhere.com> wrote in message
news:OCRVUD4$DHA.2804@tk2msftngp13.phx.gbl...
> http://tinyurl.com/yw9ea
>
>
>
> --
> Roji. P. Thomas
> SQL Server Programmer
> "Andreas.Bretl" <bretl@brainlab.com> wrote in message
> news:c1v68f$1nif1q$1@ID-79490.news.uni-berlin.de...
> > Hi all,
> > I am currently facing a strange problem. I execute a stored procedure
(in
> > the query-analyzer)
> > EXEC MyProcedureThatIsSlow
> >
> > That takes ages.
> >
> > If I copy and paste the code of the procedure into the query-analyzer it
> > runs thousand times faster.
> >
> > I already looked at the "Estimated Execution Plan", inspected the
Indexes
> > but I can not figure out where the problem is.
> >
> > The only thing I see in the Execution Plan are some Parallelism-Tasks
but
> > this is not the first time I deal with those.
> >
> > Executing the procedure also does not put out the PRINT commands I used
> and
> > additionally the Trace-Output is in both tries the same (the one is just
> > slow).
> >
> > If anybody could point me into the right direction solving that I would
> > greatly appreciate that.
> >
> > Seize the Day
> >
> > Andy
> >
> >
> > Andreas Bretl
> > bretl@brainlab.com
> > Software Engineer
> > BrainLAB AG
> >
> >
>
>



Relevant Pages

  • Re: Image::Magick trouble
    ... >>Hi I just install ImageMagick for windows and I got a strange problem ... >>I can execute demo.pl but when I try to edit it and execute with Komodo ... > And that truth is that something may have changed in your environment, ...
    (comp.lang.perl.misc)
  • Inserting nothing takes a long time
    ... I've a strange problem with a INSERT query. ... execute. ... INSERT INTO table1 ... FROM table2 is taking 30 seconds. ...
    (comp.databases.ms-sqlserver)
  • sintax error?
    ... I'm having a strange problem, that i guess you will know the answer ... I'm writing a expect script, and i will use some procedures that David ... test...", and when i try to execute the program, i did receive the same ...
    (comp.lang.tcl)
  • Re: weird problem?
    ... Strange problem. ... Are you sure that m_nCount is also defined as an int and ... I am in dubug mode and step by step to execute the code. ...
    (microsoft.public.vc.mfc)