Where is MSDN documentation that states SQL Server 2008 only supports statement level triggers

Answered Where is MSDN documentation that states SQL Server 2008 only supports statement level triggers

  • Thursday, February 14, 2013 9:26 PM
     
     
    Is there any Micorosft documentation explicitly stating that SQL Server only supprrts statement level triggers

All Replies

  • Thursday, February 14, 2013 9:40 PM
     
     

    Hey Chuck, You mean DML triggers i.e., triggers that execute on insert, update, or delete statements? I don't know which version of SQL Server you're using, but I believe SQL Server 2005 and up support DDL and logon triggers as well:

    http://msdn.microsoft.com/en-us/library/ms189799(v=sql.100).aspx

    http://msdn.microsoft.com/en-us/library/ms189799(v=sql.90).aspx

    CA-


    Adam

  • Friday, February 15, 2013 1:33 AM
     
     

    Read

    http://bytes.com/topic/sql-server/answers/80432-statement-level-vs-row-level-triggers
    http://ask.sqlservercentral.com/questions/93689/which-among-row-level-and-statement-level-triggers.html
    http://stackoverflow.com/questions/10167346/row-level-trigger-vs-statement-level-trigger


    Many Thanks & Best Regards, Hua Min

  • Friday, February 15, 2013 2:23 AM
     
     Answered

    There are three kinds of triggers in SQL Server:

    Creates a DML, DDL, or logon trigger in SQL Server 2012. A trigger is a special kind of stored procedure that automatically executes when an event occurs in the database server.

    CREATE TRIGGER (Transact-SQL)

    The kind you mean is a DML Trigger:

    DML triggers is a special type of stored procedure that automatically takes effect when a data manipulation language (DML) event takes place that affects the table or view defined in the trigger. DML events include INSERT, UPDATE, or DELETE statements

    DML Triggers

    q.e.d.

    Of course you can typically emulate a row trigger with a statement trigger and a cursor loop, if you really need to.  But statement triggers are set-based and generally preferable.

    David


    David http://blogs.msdn.com/b/dbrowne/