Q7.自动重算积分,储值余额

2018/03/23 12:10:54

--特别说明:此脚本运算量较大,建议只能每天在晚上00:00- 6:00执行

 EXEC pDRP_VIPIntegralRecall

      @cDataTable ='##P38000375_978f_4c46_949a_247691def42blmy',
      @cEndDate='2027-12-19' 
      
UPDATE VIPCard
 SET fIntegral = ISNULL(B.fIntegral,0), fReserve = ISNULL(B.fReserve,0), dIntegralEndDate = '2027-12-19', 
     fAmount = ISNULL(B.fAmount,0), 
     cRevisor = 'Admin', dReviseDate = '2027-12-19'
 FROM VIPCard A LEFT OUTER JOIN ##P38000375_978f_4c46_949a_247691def42blmy B ON A.cVIPCode = B.cVIPCode
 WHERE A.fIntegral <> ISNULL(B.fIntegral,0) OR A.fReserve <> ISNULL(B.fReserve,0)
 DROP table  ##P38000375_978f_4c46_949a_247691def42blmy