Skip to main content
Reference

Command-line interface

Run comparisons, fail builds on unexpected drift, and export migration scripts from CI. Enterprise only.

schemasync.exe exposes comparison and script generation for use in a pipeline. It never applies changes — deployment stays a deliberate act performed by a person or by your own release tooling.

Compare two endpoints

Command Prompt
schemasync compare ^  --source "server=db-stage;database=orders;user=ci_ro" ^  --target "server=db-prod;database=orders;user=ci_ro" ^  --filters .\schemasync-filters.json ^  --report .\artifacts\schema-diff.html ^  --fail-on-difference

Exit codes

CodeMeaning
0Completed; the schemas match, or differences were found and --fail-on-difference was not set
1Differences were found and --fail-on-difference was set
2Could not connect, or authentication failed
3Invalid arguments or an unreadable filter file
4Licence missing or expired

Export a migration script as a build artefact

Command Prompt
schemasync script ^  --source "server=db-stage;database=orders;user=ci_ro" ^  --target "server=db-prod;database=orders;user=ci_ro" ^  --out .\artifacts\migration.sql ^  --include-drops false

Pass credentials from your CI secret store as environment variables rather than writing them into the command. Any connection string value may be given as %ENV_VAR%.