How to copy an inserted,updated,deleted row in a SQL Server trigger(s)
问题 If a user changes table HelloWorlds , then I want 'action they did', time they did it, and a copy of the original row insert into HelloWorldsHistory . I would prefer to avoid a separate triggers for insert, update, and delete actions due to the column lengths. I've tried this: create trigger [HelloWorlds_After_IUD] on [HelloWorlds] FOR insert, update, delete as if @@rowcount = 0 return if exists (select 1 from inserted) and not exists (select 1 from deleted) begin insert into