create trigger tri_asbon asb for insert as begin declare @rk int declare @ck int declare @sid varchar(20) select @sid=商品代码 ,@rk =入库数量,@ck=出库数量 from inserted if not exists(select * from asb where 商品代码[email protected]) insert into bsb(商品代码,数量) values(@sid,@[email protected]) else update bsb set 数量=数量+(@[email protected]) where 商品代码[email protected]end
时间: 2024-11-05 16:03:15