Well, I published a table (with a text column) and put a row filter on
the article so only about half the rows end up on the subscriber. This
works fine with the snapshot. But later on the source data is changed
with an UPDATETEXT statement. The rows that get changed on the
publisher do not match the row filter in my publication and as such are
not on the subscriber. However, that UPDATETEXT statement gets executed
on the subscriber anyway! (This is continuous transactional replication
I'm talking about.) The first statement in the batch that gets executed
on the subscriber is a simple
DECLARE @ptr varbinary(16)
SELECT @ptr = TEXTPTR(MyTextCol) FROM MyTable
WHERE <some criteria that doesn't match my row filter>
Of course this assigned a NULL to @ptr because the row doesn't exist on
the subscriber. The next statement in the batch that gets executed on
the subscriber is
UPDATETEXT MyTable.MyTextCol @ptr 0 0 WITH LOG 'blah...'
This UPDATETEXT statement raises an error (error 7133 from sysmessages)
and the transaction is rolled back, which breaks the distribution agent
(and a reinitialisation is necessary).
The problem was that the UPDATETEXT statement should never have been
executed on the subscriber because of the row filter on the published
article that prevents those particular rows from being replicated to the
subscriber. But when the UPDATETEXT statement ran on the publisher, the
row filter was essentially ignored (I can understand why, sort of, since
it's not one of the kosher DML statements - INSERT, UPDATE or DELETE)
and the UPDATETEXT statement ended up being executed on the subscriber too.
--
*mike hodgson*
http://sqlnerd.blogspot.com [quoted text, click to view] Michael Hotek wrote:
>I don't quite follow exactly what you described. Yes, I would consider it a
>bug to have a command replicated that violates the row filter.
>
>