--1.定义游标
declare cur_TblClass cursor fast_forward for select * from TblClass
--2.打开游标
open cur_TblClass
--2.1对游标操作
fetch next cur_TblClass --游标向后移动一条
while @@fetch_status=0
begin
fecth next from cur_TblClass --继续向下移动
end
--3.关闭游标
close cur_TblClass
--4.释放资源
deallocate cur_TblClass
原文:http://www.cnblogs.com/wupd2014/p/4975735.html