• Why use the output syntax, table variable and dynamic sql?

    Wouldn't the following be simpler (no permissions issue on table if user running it only has access to SP either) :

    insert into ...

    set @outputId = scope_identity()