I have transaction replication between two SQL Servers. For testing purposes I deleted a lot of records at the subscriber that still existed at the publisher.
I now know that if someone updates, or deletes some records at the publisher, which do not exist on my subscriber, then my replication is going to crash.
I know that I could also filter data at the distributor, but this would mean reinitialising my subscribers, and that would mean transferring almost 40GB over a slow link.
So, whilst I am testing my subscribed database I'd love to restrict users to only updating or deleting records at the publisher side. My source table has a date field and I want to restrict updates or deletes according to date.
Is it better to use a trigger or a constraint for this?
How can I avoid as much record locking as possible?