declare mycursor cursor for select id ,name from user open mycursor fetch next from mycursor into @a,@b while(@@fetch_status=0) begin print @a,print @b fetch next from mycursor into @a,@b end close mycursor deallocate mycursor
declare mycursor cursor for select id ,name from user
fetch next from mycursor into @a,@b while(@@fetch_status=0) begin print @a,print @b fetch next from mycursor into @a,@b end close mycursor deallocate mycursor