June 3, 2003 at 12:28 pm
I'm trying to write a very simple trigger that puts the id, first name, last name, and email address in a table after it is updated or deleted from a different table.
Your help is much appreciated.
June 3, 2003 at 3:37 pm
create trigger mytrig on tableA for update, delete as
insert mytable
select id, name, etc
from deleted
Steve Jones
June 3, 2003 at 4:45 pm
I don't know if my last post, posted. So I'll say it again. You're a genius.
One more question: What if I also wanted it to log records that were updated and put them in the same table? I tried "as deleted, updated" but that didn't work.
June 3, 2003 at 8:18 pm
See Steve Jones example above, create an update trigger and the updated contents should be in the inserted table. Also look at the update(Col) function.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply