Trigger update sequence

  • When you have a trigger for update on a table, does the table actually get updated before or after the trigger executes?

    I have an update trigger on a table that is joining on inserted and a view. The view is a select statement on 5 tables, one of them is the same table that is being updated. Will the view contain the updated data?

  • The view will show the update I believe.

    Andy

  • I believe for the context of the trigger, Andy is right. You can join on the table itself in the query (along with inserted) and it works.

    Steve Jones

    steve@dkranch.net

  • If the view is used in the trigger then yes. However external to the trigger in another user session it may not unless they are set to allow uncommited reads, I do believe.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

Viewing 4 posts - 1 through 3 (of 3 total)

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