:Perftrace
Choose where sqlcmd sends its performance trace output.
Syntax at a glance
:Perftrace filename | STDERR | STDOUT
Work example
Keep trace output separate from query results
Check that your sqlcmd variant supports performance tracing. Choose a fresh lab trace file and run a small script with tracing enabled.
Check your work Trace messages go to the selected destination without replacing the result output configuration.
Open Microsoft Learn for full syntax, permissions, and details for your version.