create procedure dbo.test instead of insert,update as declare @temp int if (select count(t1) from inserted)>0 and (select count(t1) from deleted)>0 begin select @temp=t1 from <table> where pk=(select pk from inserted) select @temp=(select t1 from inserted)-@temp update <table>(t1,t2,t3) select t1,t2,t3+3*@temp from inserted end go 试试
instead of insert,update
as
declare @temp int
if (select count(t1) from inserted)>0 and (select count(t1) from deleted)>0
begin
select @temp=t1 from <table> where pk=(select pk from inserted)
select @temp=(select t1 from inserted)-@temp
update <table>(t1,t2,t3)
select t1,t2,t3+3*@temp from inserted
end
go
试试