create trigger famount_updatess
on B
for update
as
BEGIN
declare @famount float
declare @fquty float
select @famount=famount from inserted i where i.fid in(select fid from inserted)
SELECT @fquty=SUM(isnull(fquty,0)) FROM inserted I where
fparentid IN(SELECT fparentid FROM inserted group by fparentid) GROUP BY fparentid
if UPDATE(famount)
update B set B.fprice=@famount/nullif(B.fquty,0) from b join inserted i on b.fid IN(select fid from inserted)
UPDATE A SET a.fquty=@fquty from A join inserted i on a.fid=i.fparentid where a.fid in(select fparentid from inserted)
END

這個要怎么改呢
uj5u.com熱心網友回復:
??????轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/38060.html
標籤:基礎類
上一篇:弱弱的問一句。滴滴行程修改怎么改
下一篇:Java作業
