日期:2014-05-18  浏览次数:20411 次

游标不会循环是怎么回事啊?
上次也碰到了这种问题
不知道是怎么回事
该检查哪里呢?

------解决方案--------------------
while @@fetch_status
begin
fetch cursorname into @变量
end
------解决方案--------------------
fetch next @cursorname
------解决方案--------------------
用下面的格式,在while 之前要取一次
declare i cursor for xxxxxxxx
open i
declare @a varchar(50)
fetch next from i into @a
while (@@fetch_status=0)
begin
fetch next from i into @a
end
close i
deallocate i