Вот пример ...
drop table if exists dbo.temp;
drop table if exists dbo.log;
go
create table dbo.temp(Id int, Value varchar(100));
insert dbo.temp values (1, '1'), (2, '2'), (3, '3');
go
create table dbo.log(Id int, Operation char(1));
go
create trigger trigger_temp
on dbo.temp
for update, delete
as begin
insert dbo.Log
select i.Id , 'U'
from inserted i
inner join deleted d
on d.Id = i.Id;
insert dbo.Log
select d.Id, 'D'
from deleted d
left outer join inserted i
on i.Id = d.Id
where i.Id is null
end;
go
insert dbo.temp values (4, '4');
update dbo.temp set Value = '-1' where Id = 1;
delete dbo.temp where id = 2;
select * from dbo.Log
go