How to find missing records after a CSV import
When an import finishes with fewer rows than expected, the fastest useful question is not only “how many are missing?” but “which source keys never reached the target?”
1. Keep a stable identifier in both datasets
Export the source file and a target snapshot with a common key such as customer ID, product code or transaction reference. If the identifier is composite, retain every field needed to make it unique.
2. Build a set of target keys
For each target record, build the selected key and store it in an indexed structure. Then walk through the source records and check whether each source key exists in the target. This avoids repeatedly scanning the entire target dataset.
For large files, an indexed comparison is materially more efficient than checking every source row against every target row.
3. Treat duplicate keys as a separate problem
A duplicate can make a supposedly missing-record check misleading. If a key appears more than once in either dataset, report it separately instead of choosing one occurrence arbitrarily.
4. Do not rely on row counts alone
If the source contains 10,000 rows and the target also contains 10,000 rows, the import can still be wrong. A missing source record and an unexpected target record can leave the total unchanged.
Reconciliation should therefore report both missing and extra keys.
5. Check matched records for changed values
After confirming that the same key exists on both sides, compare important mapped fields. This catches transformations or truncations that did not remove the row but altered its content.
6. Export the discrepancies
A compact issue CSV with issue type, key, column, source value and target value is easier to review than manually searching two large spreadsheets. It also provides a repeatable artifact for remediation.
Find missing records without uploading your CSV
RowMend Migration Check compares source and target CSV/TSV files locally and separates missing, extra, changed and duplicate records.
For a broader post-migration checklist, read how to validate data after a database migration.