关于游标的使用

类别:.NET开发 点击:0 评论:0 推荐:

begin transaction
declare mycursor Cursor for
select stu_no,score,words from belind_console where college_id=@college_id
for update of score

open mycursor
while(0=0)
begin
    fetch next
    from mycursor
    into @stu_no,@hhg,@words
    if @@fetch_status<>0
    break
    else
              begin
        --do someting
             end
end
close mycursor
deallocate mycursor

本文地址:http://com.8s8s.com/it/it44244.htm