• Try this...

    update foo

    set b = 'this is'

    OUTPUT DELETED.a INTO @foo2

    from foo f

    inner join bar b

    on f.c = b.y

    DELETED.a will update previous value and INSERTED.a will update the new value in @foo2 table.