日期:2014-05-17 浏览次数:20556 次
ALTER TRIGGER updatebase
ON dbo.tb
for update
as
update otherTB set col=a.col from(
select a.* from inserted a inner join deleted b on a.id=b.id
and a.col<>b.col) a where otherTB.id=a.id
ALTER TRIGGER updatebase
ON dbo.Table1 for update
as
select *
from deleted as d
inner join dbo.Table1 as t on d.ID=t.ID and d.Name<>t.Name
ALTER TRIGGER updatebase
ON dbo.Table1 for update
as
if exists(select *
from deleted as d
inner join dbo.Table1 as t on d.ID=t.ID and d.Name<>t.Name)
begin
--your code
end
else
begin
--your code
end