关于游标
--------------关于游标----------------------------------
--更新state=0的用户积分
declare cur cursor for select jifen,userid from tb_lipinjorder where lipinjID=@id and state=0
open cur
fetch next from cur into @temJifen,@temUserID
while @@fetch_status=0
begin
--操作
fetch next from cur into @temJifen,@temUserID
end
CLOSE cur
DEALLOCATE cur