我做了一个存储过程
ALTER proc [dbo].[MakeOrder]
@barcode varchar(50),
@packs int ,
@units int,
@Eid int
as
begin
insert into Orders (Barcode,Price,PacksQty,UnitQty)
values (@barcode,dbo.GetOrderPackPrice(@packs,@barcode)+dbo.GetOrderUniPrice(@units,@barcode),@packs,@units)
insert into OrderDetails(Eid,Date)
values (@Eid,GETDATE())
update Product
set Stock = Stock-@packs , UnitsStock = UnitsStock-@units where BarCode=@barcode
end
我想在产品表上进行更新后触发器以检查更新后 UnitsStock 列的值如果它为 0 则执行其他操作