all groups > sql server replication > may 2005 >
You're in the

sql server replication

group:

a bit confused with merge replication?



a bit confused with merge replication? uykusuz
5/13/2005 12:00:00 AM
sql server replication: hi all;
when i first read about merge replication , i used to think that:
when synchronized,subscriber receives changes at publisher and publisher
receives changes at subscriber and therefore both would always have same
data.

but when i configure a merge replication with pull subscription (in fact,
anonymous ) and do some tests , i see that changes in the subscriber are
propogated to publisher and deleted from subscriber. subscriber always has
the same the data when the initial snapshot was applied.


Bol says that i would mark subscription for reinitialization to get new
schema and data at the next synchronization. But reinitialization is done
before synchronization therefore changes at the subscriber will be
overwritten.

and i am using dynamic snapshot also.

What i want to do is to make subscriber and publisher have same data after
a synchronization.

Do i have to mark subscription for reinitialization after every
synchronization ? but then how can i preserve last changes at the
subscriber?

and dynamic snapshot job is now running on schedule.
is there way to make this job run after every synchronization so that
latest data and schema is always available.

thanks in advance....


Re: a bit confused with merge replication? Hilary Cotter
5/13/2005 9:58:38 PM
Basically what happens is changes at the subscriber are merge with changes
at the publisher. If the changes are to the same row, it is termed a
conflict, and by default the publisher's changes will replace the changes on
the subscriber. If there are no conflicts, changes which occur on the
publisher are applied on the subscriber, and vice versa.

Use the conflict viewer to view any conflicts.

Only reinitialize if you want to propagate changes. You do not have to
reinitialize your subscription to get your publisher and subscriber to have
the same data.

--
Hilary Cotter
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]

Re: a bit confused with merge replication? uykusuz
5/14/2005 12:00:00 AM
Hilary, thanks for your answer,
but in my case, changes at the publisher are not applied to subscriber.
i insert one record to the 'TABLE_1 at the publisher and one at the
subscriber,

i get the following merge_status messages: (i use sqlMerge object at the
subscriber.)

-Uploading data changes to the Publisher
-Processing article 'TABLE_1'
-Uploaded 1 data changes (1 inserts, 0 updates, 0 deletes, 0 conflicts)

-Downloading data changes to the Subscriber
-Processing article 'TABLE_1'
-Downloaded 1 data changes (0 inserts, 0 updates, 1 deletes, 0 conflicts)

-Merged 2 data changes (1 inserts, 0 updates, 1 deletes, 0 resolved
conflicts).

Changes at the Subscriber are deleted automatically , therefore subscriber
always has the data when the last snapshot was applied..








[quoted text, click to view]

Re: a bit confused with merge replication? uykusuz
5/14/2005 12:00:00 AM
I found this on Paul Ibison's site:

----------------------------------------------------------------------------
----

How to....... avoid subscriber deletes? - when I use filtered articles and
add a record on a subscriber, it is later deleted?

----------------------------------------------------------------------------
----

Filtering works by creating a view on the publisher. Initialisation
doesn't send this view to the subscriber, and it is only checked on the
publisher. So, you can add a record on the subscriber and on synchronisation
this record will be sent as an insert to the publisher. here, the filter is
checked, and a delete is downloaded to the subscriber. If this is not the
way you want it to work you have 2 choices:
(a) modify the insert trigger on the subscriber to ensure it doesn't write
the changed record to MSmerge_contents.

(b) use partitioned views to partition your data based on the original merge
replication filter and only replicate one table.



if we modify the insert trigger on the subscriber to ensure it
doesn't write the changed record to MSmerge_contents ,

then this record would not be send to Publisher , am i wrong or miss
something?

i did not understand b. can someone explain it?

and isn't there a formal way to prevent subscriber deletes?

thnx so much...


[quoted text, click to view]

Re: a bit confused with merge replication? Paul Ibison
5/14/2005 12:00:00 AM
Hi,
the method off my site is an unsupported hack to conveniently avoid the
proper working of merge filters. If you want a more 'standard' way of doing
things, you could have a view with an 'instead of' trigger. Inserts that
violate the filter go to a separate table with an identical structure. The
view amalgamates the records. This way, synchronization proceeds as per
usual.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Re: a bit confused with merge replication? uykusuz
5/14/2005 12:00:00 AM
Thnks Paul,
i have to do some research on these issues , i would probably be here soon
then. :)
bye...



[quoted text, click to view]

AddThis Social Bookmark Button