• You may have figured this out already, but in your last example the reason they are able to use p.Name in the output clause is because the table that p is an alias for (Production.Product) is not being directly updated by the UPDATE command, it is merely being joined on. The table that is being updated (Production.WorkOrder) is only capable of being referenced via the INSERTED or DELETED aliases.

    The same holds true for your original example. You are performing an update with a join, and the table that is being updated (foo) can only be referenced via INSERTED or DELETED. You could, however include columns from the table you are joining on (bar). For example:

    update foo

    set b = 'this is'

    --OUTPUT f.a into @foo2

    OUTPUT b.y into @foo2

    from foo f

    inner join bar b

    on f.c = b.y

    If you want to OUTPUT column(s) from foo that is not being effected by the SET statement, you can use either INSERTED or DELETED to get its value, as the before/after update value for the column will be identical.