feat: add -j flag for raw error messages by dlevy-msft-sql · Pull Request #624 · microsoft/go-sqlcmd

@dlevy-msft-sql

Implements the -j flag from ODBC sqlcmd that prints only the error
message without the Msg/Level/State/Server/Line header prefix.

Changes:
- Add RawErrors field to SQLCmdArguments struct
- Add -j/--raw-errors flag in cmd/sqlcmd/sqlcmd.go
- Add rawErrors parameter to NewSQLCmdDefaultFormatter
- Modify AddError in format.go to skip header when rawErrors is true
- Add command line tests for -j flag
- Add unit test TestFormatterRawErrors
- Update README.md with documentation

@dlevy-msft-sql

- Add TestFormatterErrorWithProcName test
- Verifies that errors with ProcName include Procedure in the header

@dlevy-msft-sql

@dlevy-msft-sql dlevy-msft-sql changed the title Add -j (--raw-errors) flag for printing raw error messages feat: add -j flag for raw error messages

Feb 5, 2026

@dlevy-msft-sql