GeezerVison is showing github.com — Send GO batch text verbatim, like sqlcmd; release 0.1.17 by jwcraig · Pull Request #2 · jwcraig/sql-server-cli
Conversation
jwcraig
commented
Oct 9, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Why
A check of 0.1.16 ran a real deployment script through sscli and through sqlcmd -b, each on a fresh copy of the same database. Both runs succeeded, but the stored trigger definitions had different SHA-256 hashes.
The cause is in the GO splitter: it trimmed each batch and re-joined its lines with LF. The server stores a module's batch text as its definition, so sscli dropped trailing blank lines, leading whitespace and CR line endings that sqlcmd keeps. Such scripts need the module body byte for byte.
A script saved with a UTF-8 byte order mark also failed with "Incorrect syntax near ''".
What
- Each batch is now an exact slice of the script. Whitespace-only batches are still skipped.
- A leading byte order mark (BOM) is skipped.
- Unit tests now expect verbatim text.
- A new DB test checks that a temp procedure's stored definition equals its batch text byte for byte (CRLF, a BOM, and leading and trailing blank lines).
- The README is updated, and the version is bumped to 0.1.17.
Verification
cargo fmt --check, clippy -D warnings and cargo test all pass.
- The opt-in DB tests pass: 4 of 4 against a local scratch DB.
- On LF and CRLF scripts, the stored procedure definition hash now matches
sqlcmd -b exactly; with 0.1.16 the CRLF case differed. The BOM script now runs, where 0.1.16 failed on it.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Batches were trimmed and their lines re-joined with LF, so a module created
by a script (CREATE TRIGGER, CREATE PROCEDURE) stored a different definition
than sqlcmd stores: trailing blank lines, leading whitespace and CR line
endings were lost. A script saved with a UTF-8 byte order mark also failed
with a syntax error. Batches are now exact slices of the script, and a
leading byte order mark is skipped.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.