Now try inserting data into the TestTable by using this line Insert into TestTable values('03', 'CDE') You can create similar triggers for Update and Delete as well. For Update, there is no logical table, but have to use Inserted. For Delete, there is a table called Deleted. Use Deleted instead of Inserted in the above trigger for deletion.

Now lets create a trigger for Instead Of Delete. This can be used to intercept any modifications to the table like insert, update or delete. Below example is for Instead of delete. As explained before, since we are checking on TestTable, we have to mention the table name and Instead Of delete.

Most of the body is same except that, we are checking if emp id is '01'. If yes, then prints the message and rollsback. if not deletes it.