Wednesday, March 7, 2012

i need to cancel conflict when replication

Dear Sir,
i need to make merge application.
the problem is ,i need to make the replication every 3 hours,if there are a
conflict it will deletes the conflicting rows for the tables
that have primary keys.
i need each row for the same table at publisher and subscriber will be
replicated to each other,
but what happen is one of them deleted !!!!!
I can not use identity ranges to solve this problem that because of the
business needs of the software which i implement.
Thanks alot
Tamer
From what you describe it sounds like you want the Susbcriber to "win" primary key conflicts.
To do this you would need to click on the articles properties (the three dots to the right of your table name) in the specify articles dialog when creating your merge publication, and then in the resolver section, select the Use this custom resolver secti
on and select "Microsoft SQL Server subscriber always wins conflict resolver.".
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Tamer Nagi" wrote:

> Dear Sir,
> i need to make merge application.
> the problem is ,i need to make the replication every 3 hours,if there are a
> conflict it will deletes the conflicting rows for the tables
> that have primary keys.
> i need each row for the same table at publisher and subscriber will be
> replicated to each other,
> but what happen is one of them deleted !!!!!
> I can not use identity ranges to solve this problem that because of the
> business needs of the software which i implement.
> Thanks alot
> Tamer
>
>
|||Thanks for your reply.
But what i need exactly is,
the rows of publisher inserted at publisher and subscriber AND
the rows of subscriber inserted at publisher and subscriber
without delete any rows if conflict happening because of the existance of
the primary key in the table.
Example:
if i have Table name= Department
and i insert department="support" at the publisher with primary key=1 and
department="marketing" with primary key=1 at the subscriber
i need the two department inserted at the publisher and the subscriber with
department="support" has primary key=1 and department="marketing" has
primary key=2
"Hilary Cotter" <hilaryk@.att.net> wrote in message
news:CD5D0265-6440-4695-8BA1-769E87B1BD00@.microsoft.com...
> From what you describe it sounds like you want the Susbcriber to "win"
primary key conflicts.
> To do this you would need to click on the articles properties (the three
dots to the right of your table name) in the specify articles dialog when
creating your merge publication, and then in the resolver section, select
the Use this custom resolver section and select "Microsoft SQL Server
subscriber always wins conflict resolver.".[vbcol=seagreen]
> --
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
>
> "Tamer Nagi" wrote:
are a[vbcol=seagreen]
|||Tamer,
If your subscriber insert needs to hold, but the PK column has to be altered
then you'll have to avoid the conflict as this precludes bith inserts
remaining. As you mention in your first post, this is normally done by
partitioning the data, eg using identity ranges. I would use this
methodology, and have another column which has an item counter number for
use in your business application.
hth,
Paul Ibison
|||Tamer,
Probably you need to implement your own custom conflict resolver.
Raj Moloye
|||I think the suggestion of separate PK seed and increment values is the best
way to go. A popular example of this is to start the Publisher with a seed
of 1, an increment of 2. Then start the Subscriber with a seed of 2 and an
increment of 2. This makes the odds on the Publisher, and the evens on teh
subscriber. Then everything replicates both ways just fine. New records
from both sides replicate without any conflicts. Hope this helps.
"Raj Moloye" wrote:

> Tamer,
> Probably you need to implement your own custom conflict resolver.
> Raj Moloye
>
>

No comments:

Post a Comment