Explanation of tirgger firing

  • What is the explanation of when triggers fire when doing an insert into using a select statement?

    It looks to us like our trigger is only executing once for the insert as opposed to the number of records that are inserted?

    I think I can understand either explanation - just looking for clarification.

  • The trigger will fire only once for each Insert statement, regardless of the number of records inserted by the statement (if will even fire once if 0 records are inserted).

    The same is true for Upate and Delete triggers.

    For your Insert trigger, the pseudo 'inserted' table will contain ALL of the records added by the Insert statement, and is available to the trigger to use in exactly the same way as any other table.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply