Add post-migration validation scripts for Cosmos DB to SQL migration#99
Draft
Copilot wants to merge 3 commits into
Draft
Add post-migration validation scripts for Cosmos DB to SQL migration#99Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
- 01-RowCountValidation.sql: Row count comparison with configurable tolerance - 02-DataIntegrityChecks.sql: FK integrity, index/PK validation, checksums, NULL compliance - 03-SampleDataComparison.sql: First/last N rows per table, data type summary - 04-PerformanceBaseline.sql: Space usage, index stats, fragmentation, wait stats - RunAllValidations.ps1: PowerShell orchestrator with consolidated reporting - docs/post-migration-validation.md: Usage guide and integration documentation - .gitignore: Add ValidationResults/ to ignored paths Co-authored-by: JoshLuedeman <6021644+JoshLuedeman@users.noreply.github.com>
…nsistency, docs improvement Co-authored-by: JoshLuedeman <6021644+JoshLuedeman@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Create automated SQL scripts for post-migration validation
Add post-migration validation scripts for Cosmos DB to SQL migration
Feb 20, 2026
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.
Description
Post-migration validation suite: SQL scripts + PowerShell runner to verify data integrity, row counts, and performance after Cosmos DB → SQL migration.
Type of Change
Changes Made
Scripts/PostMigration/01-RowCountValidation.sql— Compares expected vs actual row counts per table with configurable tolerance, PASS/FAIL/WARNING per tableScripts/PostMigration/02-DataIntegrityChecks.sql— FK orphan detection, index/PK existence,CHECKSUM_AGGper table, NOT NULL complianceScripts/PostMigration/03-SampleDataComparison.sql— First/last N rows per table (PK-ordered), column type summary, empty table warningsScripts/PostMigration/04-PerformanceBaseline.sql— Space usage, index usage stats, fragmentation, scan timing, wait stats, missing index suggestionsScripts/PostMigration/RunAllValidations.ps1— Orchestrates all scripts, generates per-script + consolidated reports, supports Windows/SQL auth,--SkipScripts, exit code 0/1docs/post-migration-validation.md— Usage guide, script details, common issues, integration workflow.gitignore— AddedValidationResults/Testing
Cosmos DB Testing
Documentation
Security Considerations
All dynamic SQL uses
QUOTENAME()for identifier injection prevention. PowerShell credentials useConvertTo-SecureString.Screenshots (if applicable)
N/A — script-only changes, no UI.
Additional Notes
Scripts are standalone SQL files runnable via
sqlcmdorInvoke-Sqlcmd. The01-RowCountValidation.sqlrequires populating@ExpectedCountsfrom the assessment report before execution. All other scripts auto-discover tables viasys.tables.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.