Conditional Deletion in Replication | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Conditional Deletion in Replication

I am developing a transactional replication plan. I have one table
that most of the time I do not want to replicate deletions. There is
an exception to this rule. If the status_id of another table is false,
then the deletion should be replicated. I have been having difficulty trying to put this condition in place. I
have tried modifying the sp_MSdel_dboTable stored procedure. I have
removed the if @@rowcount check and replication errors with the
— Error executing a batch of commands. Retrying individual commands.
Eventually, it will fail with the message: if @@trancount > 0 rollback
Any ideas on how to get around this issue?
Publisher: SQL 2000
Distributor: On a separate server
Subscriber: SQL 2005
Thanks for any help I can get.