Add SQL Server 2025 encryption options to sqlcmd calls in PostProcess.cmd#508
Open
Add SQL Server 2025 encryption options to sqlcmd calls in PostProcess.cmd#508
Conversation
….cmd - Accept EncryptConnection and TrustServerCertificate as new parameters (%4, %5) - Conditionally build SQLCMD_ENCRYPTION_OPTS with -Nm and -C flags - Pass these options to all three active sqlcmd.exe calls - Pass EncryptConnection and TrustServerCertificate from CredentialManager in fmImport.cs - Update SHA256 hash in ScriptIntegrity.cs to reflect PostProcess.cmd changes Agent-Logs-Url: https://github.com/microsoft/SqlNexus/sessions/252e6ca7-99cd-4b6d-9489-86b2a166faeb Co-authored-by: PiJoCoder <23519517+PiJoCoder@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/SqlNexus/sessions/252e6ca7-99cd-4b6d-9489-86b2a166faeb Co-authored-by: PiJoCoder <23519517+PiJoCoder@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update sqlcmd and bcp calls for SQL 2025 support
Add SQL Server 2025 encryption options to sqlcmd calls in PostProcess.cmd
Apr 25, 2026
Agent-Logs-Url: https://github.com/microsoft/SqlNexus/sessions/f977adab-1840-4b39-bf7d-44d18b8aa858 Co-authored-by: PiJoCoder <23519517+PiJoCoder@users.noreply.github.com>
PiJoCoder
approved these changes
Apr 25, 2026
Collaborator
PiJoCoder
left a comment
There was a problem hiding this comment.
Ran through tests. Looks good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Enables the
sqlcmd.exeencryption flag inPostProcess.cmdto-N(opportunistic encryption, supported by all sqlcmd versions). Also updates the SHA-256 hash inScriptIntegrity.csto match the new file content.Fixes #427
Changes
PostProcess.cmd-Non theEncryptConnection=truebranch; updated commentScriptIntegrity.csPostProcess.cmdHow to Test
Prerequisites
.zipdropped into the install folder).sqlplanfiles is enough to exercise the post-processing path)Test 1 – Script integrity check passes
sqlnexuslog*.txtfile), confirm you see:[ScriptIntegrity] Script 'PostProcess.cmd' integrity OK.and not
has been tampered with.Test 2 – Import with Encrypt Connection = ON
Executing: PostProcess.cmd "…" "…" "…" "true" "…"PostProcess.cmdinclude-N(and-Cif Trust Server Certificate was also checked).Test 3 – Import with Encrypt Connection = OFF
Executing: PostProcess.cmd "…" "…" "…" "false" "…"-Nflag appears in the logged sqlcmd commands.Test 4 – Backward compatibility with legacy ODBC-based
sqlcmd.exesqlcmd.exeis the ODBC-based version (not go-sqlcmd — check withsqlcmd -?; the ODBC version printsMicrosoft (R) SQL Server Command Line Tool).-Nmflag this would have failed withunknown option.Test 5 – Direct command-line smoke test
Open a command prompt in the SQL Nexus build output folder and run:
Verify:
unknown optionerror from sqlcmd.Creating tblPlansTempandSQL Nexus PostProcessing complete.Then repeat with
"false" "false"and confirm the same outcome (no-N).