{#- SQL Server: capture output parameters as a second result set.
    Appends a SELECT for the declared output variables after the
    pre_execute + run batch so cursor.nextset() can retrieve them.
    Each variable is aliased (stripping the leading @) so the result
    set columns have meaningful names. -#}
{{ pre_execute }}
{{ run }}
SELECT {% for out in outputs %}{{ out }} AS [{{ out.lstrip('@') }}]{% if not loop.last %}, {% endif %}{% endfor %};
