0% found this document useful (0 votes)
33 views

Trigger

This database trigger runs for both insert and delete operations on the empname table. It inserts the inserted records' name fields into the dupempname table and inserts the deleted records' name fields into the delnametab table. The trigger logs both inserted and deleted record names on empname table modifications.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Trigger

This database trigger runs for both insert and delete operations on the empname table. It inserts the inserted records' name fields into the dupempname table and inserts the deleted records' name fields into the delnametab table. The trigger logs both inserted and deleted record names on empname table modifications.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

ALTER TRIGGER CatchInsertDelete

ON empname
FOR INSERT, DELETE
AS
INSERT INTO dupempname (dupname)
SELECT name FROM Inserted
INSERT INTO delnametab (delname)
SELECT name FROM Deleted
Go

You might also like