抓取订单触发器_Our Dream Will Come True!_百度空间

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


create trigger [zhua]
on [dbo].[df_TradeGoods]
for insert
as
--货品编号,货品数量,日期,总额,单价,交易编号
declare @goodsno varchar(50),@goodscount money ,@date datetime,@Total money,@Price money,@tradeid varchar(50),@shop varchar(max),@status varchar(max),@stockplace varchar(50),@spec varchar(50),@id varchar(50)
select @goodsno=goodsno,@id=tradeid,@spec=spec,@goodscount=Count,@Total=Total,@Price=price,@tradeid=tradeid,@stockplace=stock_place from INSERTED
select @shop=Shop,@status=tradeStatus from df_Trade where
select @date=getdate();
insert into sun_Trade(TradeGoodsNo,TradeGoodsCount,TradeDate,TradeShop,TradeStatus,price,total,stockplace,spec)values(@goodsno,@goodscount,@date,@shop,@status,@Price,@Total,@stockplace,@spec)


1 2010年04月24日 星期六 16:06 |
insert into sun_Trade (tradegoodsno,tradegoodscount,tradedate,tradeshop,tradestatus,price,total,stockplace,spec) select goodsno,count,tradetime,Shop,TradeStatus,price,b.total,stock_place,spec from df_Trade as a,df_TradeGoods as b where a.id=b.tradeid;

郑重声明:资讯 【抓取订单触发器_Our Dream Will Come True!_百度空间】由 发布,版权归原作者及其所在单位,其原创性以及文中陈述文字和内容未经(企业库qiyeku.com)证实,请读者仅作参考,并请自行核实相关内容。若本文有侵犯到您的版权, 请你提供相关证明及申请并与我们联系(qiyeku # qq.com)或【在线投诉】,我们审核后将会尽快处理。
—— 相关资讯 ——