Automate SQL Server Comparisons
SCT supports command-line automation, allowing you to schedule and script comparisons without any manual interaction.
Save a Comparison Session
First, run your comparison manually and save the session. Click the "Save" button on any results screen. SCT will automatically assign a unique Comparison ID to the saved session — note this ID, as you'll need it for the command line.
You can save as many comparison sessions as you need — one for each pair of databases or environments you want to monitor.
Run from the Command Line
Use the /RunSavedComp parameter followed by your saved comparison ID:
In this example, 4 is the ID of the saved comparison session to run. Replace it with your actual ID.
Schedule or Script It
Use the command above in any tool that can launch an executable — Windows Task Scheduler, a batch script, a CI/CD pipeline, or any automation framework. SCT will run the comparison silently and produce results without any manual interaction.
What You Can Automate
Nightly Environment Drift Check
Schedule a nightly comparison between test and production. Get alerted immediately when environments diverge.
Pre-Deployment Verification
Run a comparison as part of your deployment pipeline to confirm all schema changes are included before go-live.
Audit & Compliance Reporting
Generate regular comparison reports between environments for audit trails and change management documentation.