|
Posted by Jimbo on 10/20/05 00:02
I have a cursor here that appears to never stop running even though the
record set that populates it is only 22 records
heres the code:
declare cursorfinal cursor for
select appointmenteffdate, appointmentDuration, provideroid from @main
open cursorfinal
FETCH NEXT FROM cursorfinal
INTO @aff, @duration, @poid
WHILE @@FETCH_STATUS = 0
BEGIN
delete from @main_temp where (appointmenteffdate between @aff and
dateadd(minute, @duration , @aff) or
dateadd(minute,appointmentduration,appointmenteffdate ) between @aff
and dateadd(minute, @duration , @aff))
and provideroid = @poid
select @poid
END
CLOSE cursorfinal
DEALLOCATE cursorfinal
Navigation:
[Reply to this message]
|