AFTER a trigger fires after a DML operation. INSTEAD of trigger launches a DML operation instead .
A big difference. INSTEAD OF allows you to redefine functionality or implement functionality that is otherwise not supported. The common place I use is to create updatable views. Sometimes a view cannot be stored in a key, but as a designer you can find out which base tables you want to update, so that you can do this by writing specific logic to perform the update backstage. An alternative is to simply write a stored procedure and force developers to call these procedures instead of executing DML in the view, but DML on the views is a good abstraction, in my opinion, because developers can process views such as tables. Here's what a relational design should look like.
As for βafter a unique key restriction,β the AFTER trigger will occur after the DML completes successfully, so it will happen after any violations (which will result in a rollback).
source share