use pubs;
go
if exists(select name from sysobjects
where name='ReCalculateCost' and type='TR')
drop trigger ReCalculateCost
go
create trigger ReCalculateCost
on Sbill
for update,insert,delete
as
begin
update Ssum
set Scost=(select sum(Samount*price) from Sbill
where Ssum.Scode=Scode)
end
go
if exists(select name from sysobjects
where name='ReCalculateCost' and type='TR')
drop trigger ReCalculateCost
go
create trigger ReCalculateCost
on Sbill
for update,insert,delete
as
begin
update Ssum
set Scost=(select sum(Samount*price) from Sbill
where Ssum.Scode=Scode)
end
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货