Procedure unexpectingly stopping

Procedure unexpectingly stopping

Post by Paul John Summers, Jr » Fri, 24 May 2002 22:19:57



I am running a batch procedure on a table that has over 700,000 records.
It's going through each of those records and doing a search on the key to
another table and updating some values based on that search. However, the
batch seems to be stopping each time at just under 25,000 records. The
transaction log is not full... any ideas why this is stopping? This
procedure is going to take days to run and this setback is annoying.

Thanks in advance for any and all help

 
 
 

Procedure unexpectingly stopping

Post by Tibor Karasz » Fri, 24 May 2002 22:18:16


Any error messages?

--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sql...



Quote:> I am running a batch procedure on a table that has over 700,000 records.
> It's going through each of those records and doing a search on the key to
> another table and updating some values based on that search. However, the
> batch seems to be stopping each time at just under 25,000 records. The
> transaction log is not full... any ideas why this is stopping? This
> procedure is going to take days to run and this setback is annoying.

> Thanks in advance for any and all help


 
 
 

Procedure unexpectingly stopping

Post by Mattias Canberge » Fri, 24 May 2002 22:22:09


Are you doing this using a cursor?
If thats the case, can't you do it using a join instead?

"UPDATE Table1
SET column1 = 'something'
FROM Table1 JOIN Table2 ON Table1.Key = Table2.Key"

Cursors should be avoided when possible.

/Mattias



Quote:> I am running a batch procedure on a table that has over 700,000 records.
> It's going through each of those records and doing a search on the key to
> another table and updating some values based on that search. However, the
> batch seems to be stopping each time at just under 25,000 records. The
> transaction log is not full... any ideas why this is stopping? This
> procedure is going to take days to run and this setback is annoying.

> Thanks in advance for any and all help