Use GUID, not IDENTITY as a primary key for tables that are required "merge-like replication”.

I have the following scenario. Vendor has a database with table having some vendor-provided data inserted. Customers have a copy of the database with ability to add new rows to the same table, but they should not delete some vendor-provided records. Periodically vendor sends patches/updates with additional records to be added to the same table. Someone can say that a better design will be to store vendor and customer data in separate tables, but the structure of both types of records is identical and for application is simpler to have them in the same table. I’ve named the scenario "merge-like replication”- it does not use MS SQL Server Merge Replication, but use proprietary methods to deliver changes to customer databases.
Initially the table had an IDENTITY surrogate key, which is a common approach.

But it causes a lot of complexity in replication. In my scenario it obviously doesn’t work on customer copies of databases, that have different (and overlapping) identity values.

So I have to change IDENTITY primary key to GUID (see posts here and here) and it should do the work .

posted @ Thursday, August 03, 2006 9:31 AM

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
Please add 4 and 2 and type the answer here:
 

Live Comment Preview:

 
«August»
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456