all groups > sql server replication > march 2006 >
You're in the

sql server replication

group:

Conditional Deletion in Replication


Conditional Deletion in Replication emreeves
3/30/2006 1:33:31 PM
sql server 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
messages:

-- Error executing a batch of commands. Retrying individual commands.

Eventually, it will fail with the message: if @@trancount > 0 rollback
tran

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.
Re: Conditional Deletion in Replication emreeves
3/30/2006 2:42:55 PM
Thanks! This sounds better than the next approach I was going to
try... creating a 1st Insert/Update trans replication, and a 2nd Delete
only with row filtering.

BTW - Thanks very much for your replication book. It has helped loads
this past few weeks.
Re: Conditional Deletion in Replication Hilary Cotter
3/30/2006 5:32:38 PM
You need to replicate an indexed view as a table on the subscriber. The
indexed view would only "show" rows which match the status_id in the other
table.
--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

AddThis Social Bookmark Button