Trigger gets called only once per update regardless of the number of rows affected. That is why you are seeing the behavior you are seeing. So what your trigger code should be something like this:CREATE TRIGGER trgAfterUpdate ON dbo.CustomersAfter UPDATEASinsert into Customers_Audit(LastName,FirstName_Old,FirstName_New,LogDate) SELECT i.LastName, d.Firstname, i.FirstName, GETDATE()FROM INSERTED i FULL JOIN DELETED d ON d.Lastname = i.Lastname;
Apart from the question of the trigger misbehaving, couldn't you change your merge statement as shown below to update only if first names are different?....ON C.LastName = NC. LastNameWHEN MATCHED AND C.FirstName <> NC.FirstName THENUPDATE SET C.FirstName = NC.FirstName...