update器
大家在做一存管理中,出後存少。如果要出行修改,那存又怎增加和少呢!!!!
[解决办法]
---amount 数量
create trigger Stock_update on 出库表
for update
as
update Stockamount
set amount=amount+(i.amount-d.amount)
from inserted i join deleted d
where
i.i.物品ID-d.物品ID
and Stockamount.物品ID=i.物品ID