The two tables must have a PK in common.This is for sqql server but you can convert it.create trigger tr_mytbl on mytbl for insert, update, deleteasif not exists (select * from deleted) -- insert or no op insert indextbl select pk, col1, col2 from insertedelse if exists (select * from inserted) -- update update indextbl set col1 = i.col1 , col2 = i.col2 from indextbl t join inserted i on i.pk = t.pkelse -- delete delete indextbl from indextbl t join deleted on d.pk = t.pk
==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy.