I recently stumbled on the following cursor implementation:
open cursor while 1=1 begin fetch next if @@fetch_status <> 0 break (cursor logi