您的位置:首页 > 博客中心 > 数据库 >

更新数据库触发器

时间:2022-03-10 18:09

//复制优惠券表解钩 Use HSHDBNew SELECT * INTO TempExistCoupon FROM DiscountActivityPager WHERE 1=2

--update触发器 Create TRIGGER tri_update   ON  DiscountActivityPager           AFTER update  as begin  if update(UDSateID) and (select top 1 UDSateID  from DiscountActivityPager WHERE UDID=(select top 1 UDID from Deleted))=‘2‘ INSERT INTO [TempExistCoupon] (UDID,UserID,BID,DID,UDNO,UDCode,UDDateTime,Memorandum,DiscontDetail,BusName,UDSateID,CheckDate,CheckIntegralCount,Ratings,StarLevel,CheckContentStr,BEID,UserCount,BatNo) SELECT [UDID],[UserID],[BID],[DID],[UDNO],[UDCode],[UDDateTime],[Memorandum],[DiscontDetail],[BusName],[UDSateID],[CheckDate],[CheckIntegralCount],[Ratings],[StarLevel],[CheckContentStr],[BEID],[UserCount],[BatNo] FROM DiscountActivityPager  where UDID=(select top 1 UDID from Deleted) end

更新数据库触发器,布布扣,bubuko.com

热门排行

今日推荐

热门手游