Stored procedure taking more time than expected

  • Hello All,

    I am new to sql server,am working in sql server 2000,We are facing very strange problem.

    There is a stored procedure which was running fine before but it certainly running slowly for last couple of days.

    previously it used to take only 1 hour but now days it is taking more than 24 hours,though its finished successfully.I have tried some steps like rebuilding indexes in the tables and running execution plan to check where exactly it is taking time,but somehow that couldnot fix the problem.Need your help on this.

    Many thanks in advance

  • If you would only post stored procedure code...

    Without seeing the code it's impossible to advise anything concrete.

    It may be due to:

    1. Parameter sniffing

    2. Tables require update statistics

    3. Bad code

    and many other things...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • Just to add my $ .02, one hour is still a very long time, unless you're moving 1TB of data.

    Are you sure there's no tuning opportunity in that code?

    -- Gianluca Sartori

  • That is what we are trying now,like we are trying to avoid "not in " instead of that I am trying to use left outer join,but still I am not getting the desired result,and also we have more complicated stored procedures and those are running fine,so it seems may be some thing wrong with the db.

  • can you post the definition of the stored proc, the definitions of the tables and indexes used by the proc so that people can take a look at it and determine if it is the DB or the proc which is the problem?

  • I think you might want to post the execution plan as well.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply