I have a stored procedure that updates 1000 to 50000 records at a time (depending on dbase traffic) by iterating through a cursor on a subset table. Each line is processed by a second stored procedure that updates the corresponding row in the main table.
I am encountering an issue where occasionally I encounter an error on the update (unique index violation, truncated field, etc.) I need to find a way that if the cursor hits an error it will continue on to the next row and not stop updating all other records. Currently it completely stops after the first error. This is a scheduled job in SQL Agent.
The second item I would like to do is return the error to a log table, so it can be monitored and fixed.
I appreciate any help, direction, or laughs you may provide
P.A. Bowen
I am encountering an issue where occasionally I encounter an error on the update (unique index violation, truncated field, etc.) I need to find a way that if the cursor hits an error it will continue on to the next row and not stop updating all other records. Currently it completely stops after the first error. This is a scheduled job in SQL Agent.
The second item I would like to do is return the error to a log table, so it can be monitored and fixed.
I appreciate any help, direction, or laughs you may provide
P.A. Bowen