July 20, 2007 at 5:45 am
Hello,
I need to plan a transactional replication in the following scenario:
Server A (Publisher and Distributor)
Server B (Subscriber)
After the initial snapshot, i want to insert a row in the server A, then the Server A will replicate to the server B. After, i want to create a routine that deletes this row in the server A.
Conclusion: I need the data to be replicated to server B, after, the data be deleted on the server A.
Can you help me?
Thanks a lot!
July 20, 2007 at 7:09 am
July 20, 2007 at 7:38 am
All you have to do is modify the replication delete proc on the subcriber for that table. Replication creates three procs, one each for insert, update, delete, on the subscriber. Just add a 'return' as the first line of code in the stored proc and essentially replication will process the delete normally from the publisher, it will think it has been deleted, but it will still be in the table. Two things to keep in mind; one is that if you resnapshot you need to remember to remodify the proc again (or set it up to modify automatically in the post snapshot script), and that you won't be able to use the built in validation to compare publisher to subscriber since you're deliberately having them not match.
Easy to do and works fine.
July 20, 2007 at 8:35 am
Andy,
Thaaaaaaaank you very muuuuch!!!! really works fine!!
Regards,
Leonardo
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply