Showing posts with label facing. Show all posts
Showing posts with label facing. Show all posts

Wednesday, March 21, 2012

Merge replication problem

Dear Friends
I have setup merge replication for the stock database.
and facing strange problem i have ID as identity column
and the same is having property not for replication.
I am getting error for the primary key voilation and
found out the problem that the Site2 is giving the same
identity value which is already in the table. Please
suggest how i can solve the same.
Your guidence will help me to solve the problem.
Best regards
Sharad
Sharad,
if you have a limited number of subscribers, it's a good idea to choose an
identity seed/increament pair in such a way as there can be no overlap. For
example, it you just had a publisher and a single subscriber, you could have
odd and even values. There is an article by Michael Hotek which neatly
describes posibilities for many more subscribers:
http://www.mssqlserver.com/replicati..._identity.asp. I'd
set up your topology in this way so as to avoid any issues. This may involve
a lot of work initilally as you'll have to reinitialize, but in the long run
it'll make identities so easy you can set it up and then forget about it.
Regards,
Paul Ibison

Monday, March 12, 2012

Merge replication losing changes.

Hi,

I am facing a wierd problem while sync'ing. When I am do a synchonize from a mobile device to the server DB, one of my table column fails to update while all other columns get updated.

The table uses row level tracking (tried making it column level too) and the field which fails to update is a date field (Nullable).

This happens in case of syncing after updating >1 records on device. But syncing after updating just 1 record on device, this date field gets updated as expected.

Note: I have filters set for this table. The filter downloads fields only with this date field=null.

I need to downlaod all records meeting this filter condition but at the same time, this filter should not be applied while uploading changes as I think this is what the problem is.

If anyones has faced this and got a solution, please let me know.

Thanks.

What exactly does your filter look like?

|||

Do you have any default constraints on the date column or any triggers that could be affecting this column and hence affecting your expected output?

Also are you using vertical partitioning where some of the columns in the table do not go to the subbscriber? And is it that this date column is positioned after a column that is vertically filtered out?

It would be great if you can narrow down the problem and send the publication/article creation scripts.

Typically this is how a filter works:

Lets say you have a filter subset_filterclause= 'age > 20'

Now initially all the rows at the publisher that match this criteria will be downloaded, others that dont qualify will not be downloaded.

Furthermore, inserts/updates at the publisher which make rows qualify this filter will be downloaded to the subscriber.

Finally, all inserts/updates at the subscriber whether they qualify the filter or not will be uploaded to the publisher. Now all the rows that did not qualify the filter will be downloaded as deletes to the subscriber and will be delete at the subscriber.

I am trying to understand you scenario and here is what I understand:

you are saying that if you update 1 row from age=40 to age=20, you will see this update go to the publisher. But if you update 10 rows from age=40 to age=20, they will not go to the publisher?

Merge replication losing changes.

Hi,

I am facing a wierd problem while sync'ing. When I am do a synchonize from a mobile device to the server DB, one of my table column fails to update while all other columns get updated.

The table uses row level tracking (tried making it column level too) and the field which fails to update is a date field (Nullable).

This happens in case of syncing after updating >1 records on device. But syncing after updating just 1 record on device, this date field gets updated as expected.

Note: I have filters set for this table. The filter downloads fields only with this date field=null.

I need to downlaod all records meeting this filter condition but at the same time, this filter should not be applied while uploading changes as I think this is what the problem is.

If anyones has faced this and got a solution, please let me know.

Thanks.

What exactly does your filter look like?

|||

Do you have any default constraints on the date column or any triggers that could be affecting this column and hence affecting your expected output?

Also are you using vertical partitioning where some of the columns in the table do not go to the subbscriber? And is it that this date column is positioned after a column that is vertically filtered out?

It would be great if you can narrow down the problem and send the publication/article creation scripts.

Typically this is how a filter works:

Lets say you have a filter subset_filterclause= 'age > 20'

Now initially all the rows at the publisher that match this criteria will be downloaded, others that dont qualify will not be downloaded.

Furthermore, inserts/updates at the publisher which make rows qualify this filter will be downloaded to the subscriber.

Finally, all inserts/updates at the subscriber whether they qualify the filter or not will be uploaded to the publisher. Now all the rows that did not qualify the filter will be downloaded as deletes to the subscriber and will be delete at the subscriber.

I am trying to understand you scenario and here is what I understand:

you are saying that if you update 1 row from age=40 to age=20, you will see this update go to the publisher. But if you update 10 rows from age=40 to age=20, they will not go to the publisher?