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

posted on 2014-07-23 10:34  微笑点燃希望  阅读(568)  评论(0编辑  收藏  举报
font=white