About Trigger

  • Hi,

    Please can any one tell me about Before,after and instead of trigger with example?

    Regards,

    Sunil.....

  • Firstly, there's no such thing as a before trigger. The two types in SQL are instead of and after.

    A trigger will fire once per operation, not once per row. After triggers fire after the modification has happened, but while the transaction is still open. Instead of triggers fire and replace the original operation with whatever is specified in the trigger

    Have you read the section on Triggers in Books Online? Last time I checked it was fairly good and there were several examples there. If you haven't, please check it out and post any specific questions that you still have.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Shame-less self promotion since trigger behavior has changed only slightly between 2000 and 2005:

    Triggers in SQL Server 7.0 and 2000 - The Common Ground[/url]

    Triggers in SQL Server 7.0 and 2000 - What's New[/url]

    K. Brian Kelley
    @kbriankelley

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

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