Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2006
    Posts
    7

    Unanswered: Sql Server Merge Replication Deleting Records

    Hello,

    I am having problems with my sql merge replication. Whenever a user syncs up to my main database, most of their records are deleted instead of being merged.
    Or the records on the main database are inserted and it replaces the whole table with the records on the remote laptops. Is there a way to prevent this from happening? Someone please help me.

    Corey

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    A quick reference to this:
    http://www.dbforums.com/announcement.php?f=11

    I suspect the mods will refer you to the appropriate forum shortly.

    Hey Mods!!!
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    moved

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Feb 2005
    Posts
    78
    It sounds like you have not set the subscription priority correctly when you set up the subscription. If you leave it at “Use the Publisher as a proxy for the Subscriber when resolving conflicts” then the publisher is assumed to have the correct data and the changes are backed out from the subscriber.

  5. #5
    Join Date
    Dec 2002
    Posts
    1,245
    Quote Originally Posted by panacorey
    Hello,

    I am having problems with my sql merge replication. Whenever a user syncs up to my main database, most of their records are deleted instead of being merged.
    Or the records on the main database are inserted and it replaces the whole table with the records on the remote laptops. Is there a way to prevent this from happening? Someone please help me.

    Corey
    Are you using horizontal data partitioning?
    If so, are the partitions defined dynamically?

    Has the subscription been marked for re-initialization?

    Are there conflict errors that show up in the Conflict Viewer?
    If so, have you resolved these errors?


    Some background:
    1. If you are using dynamic horizontal data partitions based on some function (such as HOST_NAME()), the hostname variable is not populated automatically; you must enter it as part of the Agent Properties.

    2. If the subscription has been marked for re-initialization, then the data will be deleted from the subscriber (but it should then reappear after the synch is complete).

    3. If there is a conflict in the data that the subscriber is attempting to insert at the publisher (and the default conflict resolution is in effect), then the subscriber's data will be deleted. An example might be if the subscriber attempts to insert a record on a table with a PK and a record with the same PK at the publisher already exists, then the subscriber data will "lose out" and the publisher data will replace it.

    This can be especially problematic if you are using IDENTITY fields as PKs and have not configured appropriate ranges or set the IDENTITY values to be managed by SQL Server.

    These are some starting points; they are common issues and not intended to be an exhaustive list of solutions. Post some DDL; script the replication and attach the SQL to a post.

    Regards,

    hmscott
    Have you hugged your backup today?

  6. #6
    Join Date
    Dec 2002
    Posts
    1,245
    Mods,

    Can someone merge this with the other thread?

    Regards,

    hmscott
    Have you hugged your backup today?

  7. #7
    Join Date
    Feb 2006
    Posts
    7
    Ok thanks for the info....

    Is there a way you can give me steps on how to change these settings? I have some laptops out in the field that need this data. How would I make it where they get the data that is inserted into the empty tables that are on the laptop?

  8. #8
    Join Date
    Dec 2002
    Posts
    1,245
    bump

    panacorey; this looks similar to your other post.

    Mods, can these two threads be merged?

    Regards,

    hmscott
    Have you hugged your backup today?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •