• Use OUTPUT INSERTED.a into @foo2 If you want to get the inserted value.

    Use OUTPUT DELETED.a into @foo2 If you want to get the value replaced by update statement.