SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Error: the row was not found at the subscriber when applying the replicated command


Error: the row was not found at the subscriber when applying the replicated command

Author
Message
MillenniumAG
MillenniumAG
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 191
Dear all,

I have configured peer to peer transactional replication with two servers (PRI, BCK)
I did the following scenario in testing:
1) I have Load Balance point to PRI server, Now when PRI and BCK servers are up, The synchronization is working fine from PRI to BCK
2) when BCK server is disconnected, then make it online, the synchronization return to work good
3) when PRI server disconnected the load balance switch to BCK server and theres no problem with this
4) after step (3) when PRI server is up, then when i check the synchronization it give the following error:

Error executing a batch of commands. Retrying individual commands
the row was not found at the subscriber when applying the replicated command.


i have traced the error using browsereplcommand and i have found there is a command trying to delete record according to ID but there is no records in both databases have this ID

the table that give the error contain the following trigger in both databases

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

ALTER TRIGGER [dbo].[SysServicesLog_insert] ON [dbo].[SysServicesLog]
FOR INSERT
NOT FOR REPLICATION
AS
Declare
@ServiceType varchar(30)

Select @ServiceType = ServiceType
from inserted

DELETE FROM SysServicesLog WHERE ServiceType=@ServiceType AND SysServicesLogID NOT IN (Select

TOP 500 SysServicesLogID FROM SysServicesLog Where ServiceType=@ServiceType ORDER BY LogTimeStamp

desc)

I don't think there is problem with the trigger because its marked (Not For Replication) but maybe !!!

pls need help for this...

Thanks,
Randy-574768
Randy-574768
SSC Veteran
SSC Veteran (276 reputation)SSC Veteran (276 reputation)SSC Veteran (276 reputation)SSC Veteran (276 reputation)SSC Veteran (276 reputation)SSC Veteran (276 reputation)SSC Veteran (276 reputation)SSC Veteran (276 reputation)

Group: General Forum Members
Points: 276 Visits: 273
I have run into this problem before, too. What I found that was a record was deleted by someone on the subscriber side. Transactional replication goes from publisher to subscriber, so when the subscriber's record got deleted, there was no way for the publisher to know that. So it all gets jammed up because its trrying to send a replication command for a record that no longer exists.

There is surely a better resolution for this, but I was in a hurry to get things running again. I ran the snapshot agent and had the subscription re-initialized so the day could continue. It was painful, but it got done.

After that, I ended up switching that table to snapshot replication (as it was before) because if that happened once, it was probably going to happen again. Snapshot doesn't care what you do on the subscriber - its gonna wipe it out and repopulate it anyway.

Randy
ovelasco
ovelasco
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 39
Hello!

Control 4 repliciones on the same server but different databases, only one of them fails, and sends the following error message

"The row was not found at the Subscriber when applying the replicated command."

It confuses me that this is only one of 4 and all are configured the same way

I hope your help thanks.
Roy Ernest
Roy Ernest
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3886 Visits: 6869
It is probably because someone deleted that row from the subscriber that is throwing the error. Try to reinitialize the article on the subscriber that is failing.

-Roy
ponsee
ponsee
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 125
Instead of initializing the subscription, You can insert the deleted row in the subscriber database( if you have backup of table)
Then start the replication agent , It will fix the problem.

Best Regards
Ponnu
abhij33t
abhij33t
SSC-Enthusiastic
SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)SSC-Enthusiastic (163 reputation)

Group: General Forum Members
Points: 163 Visits: 153
This may be a simple thing but... How can I find out which row was deleted ?

Thanks
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search