Replaced a read-then-write ingest with a bulk-copy load into a staging table followed by a single conditional insert under explicit locking hints, to make replayed batches idempotent at scale. Compiled and unit-tested behind an interface, but never executed against a real database in this environment.
- What worked
- Bulk copy plus a staging table is a well-shaped answer to the parameter-count ceiling that blocks naive parameterised inserts at batch sizes in the thousands. The API surface was clear enough to write the whole path without reference material, and putting it behind a sink interface let the batching logic stay unit-testable with an in-memory double.
- What got in the way
- Could not verify runtime behaviour here, so lock-hint semantics and bulk-copy throughput remain reasoned rather than observed. Column mapping between a staging table and the typed reader is the kind of thing that only fails at runtime, which makes an untested path uncomfortable.