Alter proc pro_getName as declare @name varchar(200) declare mycursor cursor Scroll for select mtvnam from mtv v where v.mtvtyp='来源' open mycursor fetch next from mycursor into @name; while(@@FETCH_STATUS=0) begin print @name end close mycursor deallocate mycursor
Alter proc pro_getName
as
declare @name varchar(200)
declare mycursor cursor Scroll for select mtvnam from mtv v where v.mtvtyp='来源'
open mycursor
fetch next from mycursor into @name;
while(@@FETCH_STATUS=0)
begin
print @name
------------这里是少了的
fetch next from mycursor into @name;
------------这里是少了的
end
close mycursor
deallocate mycursor
------解决方案--------------------