Saturday, February 25, 2012

Merge replication between same schema databases but different data

Hi all.

I 'm trying to set up merge replication between two servers that have the same schema databases. The two database have the majority of there data the same but as well as data inserted at a later time independently on the two servers. (The two servers were connected in a merge replication scheme that failed at some later time and replication was paused, but users continout to insert data indepentedly at the two servers.)

I need to get them up and running.

I cleaned replication at both servers, I recreated the publication at the puplisher distributor and all is fine.

When I create a push subscription to the subscriper I get the error invalid column name 'rowguidcol' .

I so far managed to have merge replication running on two identical databases (schema and data).

Just some thoughts. After some reading I found that it might be related to identities and identity range or indexes. I set the identity seed and increment at 2, 2 at publisher and at 1,2 at subscriper. (On the same tables at puplisher and subscriber.) Is that ok? is that the way to do it?

Digging a bit more Using the SQL Profiler I can locate the error to happen when sp_MSaddmergetriggers executes.

Thanks allot for any help

Version.

Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38 Copyright (c) 1988-2003 Microsoft Corporation Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 4)

Hello,

I suspect there is an Identity range management issue in your app. If you just got publisher and one subscriber, suppose you can partition the Identity range as

Publisher from 1 - 1000 and Subscriber 1001 - 2000. Both step = 1.

So when you create the the merge article in sp_addmergearticle, you can specify

@.auto_identity_range='true', @.pub_identity_range = 1000, @.identity_range = 1000, @.threshold = 85.

For more details, please refer to http://msdn2.microsoft.com/en-us/library/aa237098(SQL.80).aspx.

Thanks.

|||

Thanks for the advise L Zhou

Using the SQL Profiler I can locate the error to happen when sp_MSaddmergetriggers executes.

|||

Hello George,

Please try this, running the follow DDL on the subscriber database.

ALTER TABLE [table_need_to_be_merged] ADD rowguid uniqueidentifier ROWGUIDCOL

Drop the subscription and re-create it with "NOSYNC" option. (SELECT "No, the Subscriber already has the schema and data" from the "Push Subscription Wizard" on the "Initialize Subscription" Page).

The subscription is created and the error message "Invalid column name 'rowguidcol'" should be disappeared.

If this method is still not working for you, I may need to look at your table schema.

Thanks.

This posting is provided AS IS with no warranties, and confers no rights.

|||

Thanks for the answer Zhou

I did as you said and now I do not get the rowguidcol error, but now the conflict tables are not created

Any sugestions?

Thanks

|||

How about drop pubilcation and subscription by executing sp_replicationdboption and re-create the merge publication and subscription, still use "NoSync" option. Please make sure that rowguid column is not dropped.

Thanks.

This posting is provided AS IS with no warranties, and confers no rights.

No comments:

Post a Comment