22,210
社区成员
发帖
与我相关
我的任务
分享
declare user_cur scroll cursor for
select .... --这里能够查询到10条记录
declare @xxx nvarchar(2000)
begin
open user_cur
fetch first from user_cur into @XXX
while @@fetch_status=0
begin
print(@XXX)
fetch next from user_cur into @XXX
end
close user_cur
deallocate user_cur
end
declare user_cur cursor for select .... --这里能够查询到10条记录
declare @xxx nvarchar(2000)
begin
open user_cur
fetch next from user_cur into @XXX
while @@fetch_status=0
begin
fetch next from user_cur into @XXX
print(@XXX) --只打印了5个,还有5个莫名失踪了,也没报错
end
close user_cur
deallocate user_cur
end
fetch next from user_cur into @XXX
print(@XXX) --只打印了5个,还有5个莫名失踪了,也没报错
fetch next from user_cur into @XXX