FETCH NEXT FROM rs into @a,@b,@c

解决方案 »

  1.   

    Create PROCEDURE dt_sys_fukuan AS 
     declare @shouID int,@Integrations nvarchar(50),@cause nvarchar(50)
    DECLARE rs CURSOR LOCAL SCROLL FOR 
        select Integrations,shouid,cause from mm_account where addtime <= getdate() 
    OPEN rs 
    FETCH NEXT FROM rs 
    into @Integrations,@shouID,@cause
    WHILE @@FETCH_STATUS = 0
    BEGIN 
      update china_user set Integration=Integration+ @Integrations where id=@shouID 
      insert into china_account(userid,Integrations,symbol,cause) values(@shouid,@Integrations,1,@cause) 
    END 
    FETCH NEXT FROM rs 
    into @Integrations,@shouID,@cause
    CLOSE  rs 
    delete from mm_account where addtime <=getdate() 
    GO