Files
sqlserver-collation-migration/docs/VERIFY.md

50 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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.