validate_fk_integrity
Check a table's foreign keys to find orphan child rows missing their parent. Returns constraint details and orphan counts; an empty result means referential integrity holds.
Instructions
Check one or all foreign keys of a table and report orphan rows (child rows whose parent is missing). Returns one entry per FK with constraint name, child/parent columns and the orphan count; an empty list means referential integrity is intact.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name. | |
| schema | No | Schema (owner) of the table. Optional — defaults to the server's current schema; omit rather than guess. | |
| constraint | No | Optional constraint-name filter; omit to check every FK on the table. |