Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

subscriber db synch issues

 
   Database Help (Home) -> Replication RSS
Next:  $B$3$s$K$A$o!J!|!f"O!e!|!K!?!@!J!t(B  
Author Message
solver

External


Since: Dec 19, 2008
Posts: 1



(Msg. 1) Posted: Fri Dec 19, 2008 5:18 am
Post subject: subscriber db synch issues
Archived from groups: microsoft>public>sqlserver>replication (more info?)

Hi,

I have a publisher db with a table having a trigger that updates a
column in a newly added row. So, for example, there is a table A with
column B. When a new row is added to A, trigger updates column B.

The replicate (subscriber) db's table A doesnt have above mentioned
trigger.

Now, the scenario below is not properly synching subscriber database,

1. New row ROW1 is added to table A of remote/subscriber db.
2. ROW1 is synched to master database in table A
3. trigger is called and column B in master database's table A is
updated.
4. Now column B in remote database's table A doesnt get updated for
some reason.

Following settings have been selected while setting up a publication,

Publication Type: ‘Transactional publication with updateable
subscriptions’
Snapshot Agent : ‘Create a snapshot immediately…’

For subscriber configuration,

1. ‘Run all agents at the Distributer…’
2. Agent Scheduler : ‘Run continuously’\
3. Commit at publisher: Queue changes and commit when possible
4. Initialize When: Immediately

Any help to resolve the above issue will be highly appreciated.

Thanks,
Usman

 >> Stay informed about: subscriber db synch issues 
Back to top
Login to vote
Rubén_Garrigós

External


Since: Jan 10, 2008
Posts: 20



(Msg. 2) Posted: Sun Dec 21, 2008 6:25 am
Post subject: Re: subscriber db synch issues [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Usman,

I think that if you add the trigger at the subscriber and mark it as "NOT
FOR REPLICATION" it can work (it will depend on what type of trigger is and
what you do inside your trigger). The problem is that the rowversion for the
same row is updated twice (one for the insert and another one due to the
trigger update) so it fails the final consistency check at the end of the
replication trigger at the subscriber. Another workaround can be to force to
maintain the first value of msrepl_tran_version adding to your trigger
update SET clause "msrepl_tran_version=msrepl_tran_version":

UPDATE A
SET B=whatever, msrepl_tran_version=msrepl_tran_version

You can also detect that you are running inside a replication trigger and
change your trigger logic (sp_check_for_sync_trigger:
http://msdn.microsoft.com/en-us/library/ms178612(SQL.90).aspx). Updatable
subscriptions and triggers are a difficult mix.


Regards,

Rubén Garrigós
Solid Quality Mentors

wrote in message

Hi,

I have a publisher db with a table having a trigger that updates a
column in a newly added row. So, for example, there is a table A with
column B. When a new row is added to A, trigger updates column B.

The replicate (subscriber) db's table A doesnt have above mentioned
trigger.

Now, the scenario below is not properly synching subscriber database,

1. New row ROW1 is added to table A of remote/subscriber db.
2. ROW1 is synched to master database in table A
3. trigger is called and column B in master database's table A is
updated.
4. Now column B in remote database's table A doesnt get updated for
some reason.

Following settings have been selected while setting up a publication,

Publication Type: ‘Transactional publication with updateable
subscriptions’
Snapshot Agent : ‘Create a snapshot immediately…’

For subscriber configuration,

1. ‘Run all agents at the Distributer…’
2. Agent Scheduler : ‘Run continuously’\
3. Commit at publisher: Queue changes and commit when possible
4. Initialize When: Immediately

Any help to resolve the above issue will be highly appreciated.

Thanks,
Usman

 >> Stay informed about: subscriber db synch issues 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Row not found at Subscriber - When we inserted a row at the Publisher -- this is error we got: The row was not found at the Subscriber when applying the replicated command. Since this was a new row, why would I get this error. Unrelated question: we do not proprogate changes from...

MySQL Subscriber - Hi, SQL Server 2005 sp2 The problem I face is that I try to set up a Transactional Replication between sql as a Publsher and MySQL as a Subscriber. When I use sp_browsereplcmds to see the cmd that is generated by the LogReader I see the bellow..

A useable but non-updating subscriber? - Is there a way in SQL 2005 to be able to use a subscriber to test run data and not have the updated data sent back to the publisher using any method of replication? We will have 1 publisher and 2 subscribers (all 2005), and we would like to use one o...

Drop subscriber on server - Hi, I'm working on a project with SQL 2005, merged replication and Pocket PC (Compact SQL 3.5). After trying some code, I see that server think there is a lot of subscription ( > 40 ) but in fact, there's only one !! Does anybody now a solution to..

The schedule of one subscriber altering a schedule of anot.. - I have two transactional publications using the same source database, one for the tables and one for the stored procedures. The reason for 2 separate publications is so that I can reinitilaize the stored procedure publication when changes are made to....
   Database Help (Home) -> Replication All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]