关于游标的使用

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

Published At
Categories with Web编程
Tagged with
comments powered by Disqus