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 Administration (2000)
 erratic stored procedure

Author  Topic 

cidr
Posting Yak Master

207 Posts

Posted - 2009-10-08 : 10:08:56
Hi there,

I know the explanation of my problem will be a little vague... please bare with me.

On the sql server at work there's a stored procedure (very complex) and it updates several tables using data from several views. The problem I have is that each time it's run it takes completly different times to complete.

One day it'll take 2 hours, the next, 8 hours (both out of hours).

I'm trying to avoid going to much into what the sp does as it's quite convuloted. I just wanted to ask advice on where to start to troubleshoot this type of problem

I've looked at the query plans and there are quite a few table scans but it still doesn't explain why it sometimes completes quicker than other times.

If anyone can point in a good direction or have any advice, I'd be most grateful

thanks

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2009-10-21 : 11:44:17
Different amounts of data for the different runs? Table scans, depending on the size of the tables, is usally not a good thing. Can you add some indexes that make sense for what you're doing?

Terry

-- Procrastinate now!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-10-21 : 13:01:08
do you have any idea on what sp actually does? is it that amount of data it processes is different each day?
Go to Top of Page

tripodal
Constraint Violating Yak Guru

259 Posts

Posted - 2009-10-30 : 16:00:56
Bad hardware could cause this. But with such a wide variation of time, It should be obvious with other major issues.
Go to Top of Page
   

- Advertisement -