Initial version of collation migration scripts.

This commit is contained in:
2026-02-05 07:48:34 +01:00
commit 505a9d52a6
6 changed files with 1339 additions and 0 deletions

49
docs/VERIFY.md Normal file
View File

@@ -0,0 +1,49 @@
# Verify Compare Source and Target
The script `scripts/compare_source_target.sql` compares **structure and high-level consistency** between two databases without comparing row contents.
## What is compared
1. **Rowcounts per table**
2. **Columns**: datatype, length, nullable, collation
3. **Programmable objects**: views, stored procedures, functions (hash of definition)
4. **Triggers** (hash of definition)
5. **Users/Roles**: principals existence + role memberships
## How to run
1. Open `scripts/compare_source_target.sql` in SSMS
2. Set:
- `@SourceDb` (default: `sysdb_UTF8`)
- `@TargetDb` (default: `sysdb_utf8_jr`)
3. Execute.
## Output style (quick to read)
### Live messages (SSMS Messages tab)
You get a human-readable summary per step, e.g.:
- `ROWCOUNTS | SourceTables=... TargetTables=... TablesWithRowDiff=...`
- `COLUMNS | ColumnDiffs=...`
- `MODULES | Differences=...`
- `TRIGGERS | Differences=...`
- `PRINCIPALS | Differences=...`
- `ROLEMEMBERS | Differences=...`
At the end:
`COMPARE_DONE | RowDiffTables=... | ColumnDiffs=... | ...`
### Result sets (details)
If differences exist, result sets are shown for:
- Rowcount diffs
- Column diffs
- Module diffs
- Trigger diffs
- Principal diffs
- Role membership diffs
If a section has **no differences**, youll see an `..._OK` message and no detail list.