Replication and primary key issues


 

i have customer experiencing issue unsure how resolve.  have 3 databases, 2 downstream databases replicate single database.  have same schema across 3 databases.  when devices report downstream database, records replicated up. 

what happening when customer moves device 1 downstream database other, start seeing primary key errors.  example, lets , b downstream databases, if device reported a, there record device in replicated up.  if move device b, see primary key errors.  can exact errors if necessary. 

how sql replication handle this?  expect if record exists update, not insert.  since cannot have duplicate rows same id, appears if database b replicating trying insert instead of update, can true?

add column originating server id pks , give column default of @@servername. way not these collisions. option use dbcc checkident reseed identity elements ranges of identity values not collide.

for example on server don't anything. on server b set identity values start @ 10,000,000. on server c set identity values start @ 20,000,000.


looking book on sql server 2008 administration? http://www.amazon.com/microsoft-server-2008-management-administration/dp/067233044x looking book on sql server 2008 full-text search? http://www.amazon.com/pro-full-text-search-server-2008/dp/1430215941



SQL Server  >  SQL Server Replication



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........