CREATE TRIGGER editshipment ON dbo.shipment
FOR INSERT
AS
update poorders
set accept=a.accept-d.quantity
from poorders a,(select (orderno+goodsid) as ordergoods,sum(quantity) as quantity from inserted group by orderno+goodsid) as d
where (a.orderno+a.goodsid)=d.ordergoods
FOR INSERT
AS
update poorders
set accept=a.accept-d.quantity
from poorders a,(select (orderno+goodsid) as ordergoods,sum(quantity) as quantity from inserted group by orderno+goodsid) as d
where (a.orderno+a.goodsid)=d.ordergoods
我想要的是FOR UPDATE