Can we work on both (After) and (InsteadOf) Triggers in SQL on a single table?

 Posted by Chvrsri on 12/6/2010 | Category: Sql Server Interview questions | Views: 4672 | Points: 40

We can create any type of triggers on a single table . But the thing is if we have Instead Of Trigger created on a table untill and unless it is disabled or deleted we cannot work on After Triggers.
At a single strech we cannot work on both the types.

Source: My Own Observation | Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: PandianS on: 12/6/2010 | Points: 10

Nice Point.

Somebody might think that "We can set the trigger Order - AFTER trigger as 'First' and INSTEAD OF Trigger as 'Last', So then, AFTER trigger will raise First" ?


Because we can set the Trigger Order on AFTER trigger, But we can not set the Trigger order on INSTEAD OF Trigger...!, So the INSTEAD OF Trigger will raise at First automatically/default.

Posted by: Chvrsri on: 12/6/2010 | Points: 10
Yes you are right the main advantage with Insteadof rather than after is that we can use all the three operations(insert,update,delete) can be done using a single Trigger.

Login to post response