stored procedures with loop - queueing

Database
Enthusiast

stored procedures with loop - queueing

Hi,

Due to size of data (not to blow spool space) I need to chop that big dataset with cursor looping through X millions of rows.

Our database is really busy, and each iteration of loop gets parsed individually. This results in stored procedure executing hours, simply due to sql statement executed in loop getting queued with each time loop iterates.

Is there any way of executing stored procedure in the way that it would avoid queuing looped sql statement ?

Sounds silly, but I am desparate.

Regards,

Piotr

1 REPLY
Enthusiast

Re: stored procedures with loop - queueing