replication : new features ?

  • Hi,

    I use merge replication in sql server 2000 and I always get problem whith primart key. (replication conflict)

    Is this point solved in SQL Server 2005 ?

    Tom

  • What primary key strategy are you using with your merge replication?

    With merge replication you have to use a more unique key than an integer, or bigint. Such as a guid.

    Or you can cheat, and set the identity/seed different on each server.

    Say you have 3 servers in your merge replication

    So for Server1.table1 the identity seed is 1,3 (Start at 1 and increment every 3)

    So for Server2.table1 the identity seed is 2,3 (Start at 1 and increment every 3)

    So for Server3.table1 the identity seed is 3,3 (Start at 1 and increment every 3)

    That way new inserts into tables don't have conflicting primary keys.

    I havn't read anything yet if sql sk5 has merge replication issues.

     

  • I use an integer as primary key. I hope your comments will be useful.

    Could you explain me why I should not use integer ?

    Tom

  • If you use an identity integer with the same seed and increment. and a insert happens to the same table on 2 different servers it is going to insert the records with the same primary key.

    thats why I suggest using integer with alternating identity seed/increment values. That way the integer value for the primary key will be unique.

    Usually a guid is used on merge replication because it easily solves this problem, but guids are much larger in size, and more difficult to work with.

     

     

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply