• Yep... that would be correct and that would also be why most folks think it doesn't work in the trigger as capturing the number of rows inserted, updated, or deleted that fired the trigger.  The following does work in a trigger (as strange as it looks) if it's the very first thing in the trigger code...

    CREATE TRIGGER trigger_name

    ON { table | view }

    [ WITH ENCRYPTION ]

    {

        { { FOR | AFTER | INSTEAD OF } { [ INSERT ] [ , ] [ UPDATE ] [ , ] [ DELETE ] }

            [ WITH APPEND ]

            [ NOT FOR REPLICATION ]

            AS

    DECLARE @Rows

    DECLARE ... any other variables you may need ...

        SET @Rows = @@ROWCOUNT

         IF @Rows = 0 RETURN

    ... other trigger code ...

    I'd still like to see the code that caused the original problem.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)