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)