更新数据库触发器

//复制优惠券表解钩 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

更新数据库触发器

上一篇:MySQL:Useful Commands


下一篇:Mongodb 条件查询