declare @Cursor cursor
set @Cursor=cursor for
SELECT a1,b1 FROM a
open @Cursor
fetch next from @Cursor into @a1,@b1
WHILE @@FETCH_STATUS=0
begin
if @a1=1
goto label
fetch next from @Cursor into @a1,@b1
end
DEALLOCATE @gardenCursorlabel:
............
return
代码如上,不知道当跳出时能不能释放游标
你的吧DEALLOCATE @Cursor这句写道label: 里