I'm getting a missing foreign key error when I begin transactional replication.
- Created a pull publication (live server)
- Created a copy only full backup
- Restored backup on reporting server
- Created a pull subscription on from backup (live server)
- Created a pull subscription on subscriber (reporting server)
I'm getting errors soon after looking through replication monitor:
The INSERT statement conflicted with the FOREIGN KEY constraint.
The issue is it's trying to insert a record into a table for which there's no corresponding record (although the record does exist on the live server).
Unless I've missed a step I'm not sure why this is happening. I had suspected it may be a case of distribution records getting cleaned up too early, so I disabled the SQL Agent job, but it's still happening.
Any help would be greatly appreciated.