Database sync + schema deployment in one tool
Supports SQL Server 2012 and newer
Place your license file in the application folder:
{ "Key": "DSQL-2024-E2S9-U0W1-X8D5" }
Replace with your actual license key from purchase.
Tell DeltaSQL what to sync:
[{ "SourceServer": "source-server", "SourceDB": "SourceDB", "DestServer": "dest-server", "DestDB": "DestDB", "DestTable": "Orders", "UniqueKeyColumn": "OrderId", "SourceSQL": "./query.sql", "MappingFile": "./mapping.json", "IntegratedSecurity": false, "Username": "sql_user", "Password": "your_password" }]
Password gets encrypted automatically after first run. Use "IntegratedSecurity": true
for Windows Authentication.
Write your source query:
SELECT OrderId, CustomerId, OrderDate, TotalAmount FROM Orders
Map source columns to destination:
{ "Mappings": [ {"Source": "OrderId", "Destination": "OrderId"}, {"Source": "CustomerId", "Destination": "CustomerId"} ]}
Execute the synchronization:
./DeltaSQL.exe sync config.json app.log
Define database objects to deploy (inline script or external file):
{ "Features": { "Analytics_v1": { "Version": "1.0.0", "Objects": [ { "Name": "analytics_log", "Type": "table", "Script": "IF NOT EXISTS (SELECT * FROM sys.tables WHERE name = 'analytics_log') CREATE TABLE analytics_log (id INT IDENTITY(1,1), event_data NVARCHAR(MAX))" }, { "Name": "sp_process_analytics", "Type": "procedure", "ScriptFile": "sql/analytics_procedure.sql" } ] } }}
Use "script"
for inline SQL or "script_file"
for external files.
For complex scripts, use external files:
CREATE OR ALTER PROCEDURE sp_process_analytics AS BEGIN SELECT COUNT(*) FROM analytics_log WHERE created_at > DATEADD(day, -1, GETDATE()) END
Configure database discovery with conditional deployment. DeltaSQL automatically scans your servers to find qualifying databases, then deploys only where conditions are met.
{ "Servers": ["localhost"], "Authentication": { "IntegratedSecurity": false, "EncryptConnection": true, "Username": "sql_user", "Password": "your_password", "PasswordEncrypted": false }, "Conditions": [ { "Type": "table_exists", "Name": "Orders" }, { "Type": "data_exists", "Query": "SELECT COUNT(*) FROM Orders WHERE Status = 'Active'", "Expected": "> 0" } ], "FeaturesToDeploy": ["Analytics_v1"] }
Password gets encrypted automatically after first run. Use "IntegratedSecurity": true
for Windows Authentication.
Find qualifying databases and deploy:
# Discover databases that match conditions ./DeltaSQL.exe discover deployment.json app.log # Deploy features to qualifying databases ./DeltaSQL.exe deploy features.json deployment.json app.log
View deployment status with optional JSON export:
# Basic status - console output and logging ./DeltaSQL.exe status deployment.json app.log # Status with JSON export - adds structured data export ./DeltaSQL.exe status deployment.json app.log status_export.json
Console shows human-readable status, while the optional export file contains structured JSON for automation tools.
The export file contains flat, structured data:
{ "GeneratedAt": "2024-09-28T19:30:00Z", "TotalDatabases": 2, "Databases": [ { "Server": "localhost", "Database": "ORDERS_DB", "Features": [ { "Name": "Analytics_v1", "Version": "1.0.0", "DeployedAt": "2024-09-28T18:24:29Z", "Status": "success", "Checksum": "d45550a73bc1" } ] } ] }
Perfect for CI/CD pipelines, monitoring systems, and reporting dashboards.
Database change notifications require specific SQL Server permissions and configuration:
Grant sysadmin permissions (for testing):
USE [master]; ALTER SERVER ROLE sysadmin ADD MEMBER [your_user]; USE [YourDatabase]; ALTER DATABASE [YourDatabase] SET RECOVERY FULL;
Configure tables to monitor and scripts to execute:
{ "Watchers": [ { "Server": "localhost", "Database": "ORDERS_DB", "Schema": "dbo", "Table": "Orders", "CaptureColumns": ["OrderId", "Status"], "ChangeTypes": ["update"], "PollingIntervalSeconds": 5, "IntegratedSecurity": false, "EncryptConnection": true, "Username": "sql_user", "Password": "your_password", "PasswordEncrypted": false, "Script": { "Type": "/usr/bin/python3", "Path": "./notify.py", "Timeout": 30, "RetryCount": 3 } } ] }
Type = full path to script executable (python3, python.exe, powershell.exe, node, bash)
Password gets encrypted automatically after first run. Use "IntegratedSecurity": true
for Windows Authentication.
Write an idempotent script that receives JSON via stdin:
#!/usr/bin/env python3 import sys import json # Read change data from stdin data = json.loads(sys.stdin.read()) # Check if already processed (idempotency) change_id = f"{data['OrderId']}-{data['Status']}" log_file = 'processed.log' with open(log_file, 'a+') as f: f.seek(0) if change_id in f.read(): sys.exit(0) # Already processed # Your business logic here # Example: POST to API, send email, update cache, etc. print(f"Processing Order {data['OrderId']}: {data['Status']}") # Mark as processed f.write(change_id + '\n') sys.exit(0) # Success
Script must be idempotent - safe to run multiple times with same data.
Start monitoring (runs continuously until Ctrl+C):
./DeltaSQL.exe monitor cdc-config.json cdc-monitor.log
DeltaSQL will:
Your script receives this JSON structure via stdin:
{ "OrderId": 12345, "Status": "Shipped", "__ChangeType": "update" }
ChangeType values: "insert", "update", "delete"
Deploy schema changes and maintain consistent database states across environments. Automated rollback capabilities and version-controlled database deployments.
Scale beyond manual configuration with intelligent automation for hundreds of tables. Custom business logic and transformation pipelines built to your specifications.
Complete migration strategy from legacy systems to modern architectures. Expert consultation on data integration patterns and best practices.
Ready to scale your data synchronization?
Contact Enterprise Team