+1 for guids. I use them as PK in a sync framework app. On Thu, Feb 2, 2012 at 6:59 AM, David Ames <[email protected]> wrote:
> ** ** > > If your only talking a small number of clients you can play with > seed/increment values.**** > > ** ** > > Eg:**** > > Node 1: Seed = 1, Increment = +2**** > > Node 2: Seed = 2, Increment = +2**** > > Node 3: Seed = -1, Increment = -2**** > > Node 4: Seed = -2, Increment = -2**** > > ** ** > > ** ** > > You can also assign ranges (and run the risk of running out of numbers in > the range)**** > > Node 1, Seed = 1**** > > Node 2, Seed = 100,000**** > > Node 3, Seed = 200,000**** > > Node 4, Seed = 300,000**** > > ** ** > > ** ** > > You could also use a GUID as the PK, set default = newSequentialid () to > keep fragmentation down. **** > > ** ** > > Dave**** > > ** ** > > ** ** > > ** ** > > ** ** > > *From:* [email protected] [mailto: > [email protected]] *On Behalf Of *Kirsten Greed > *Sent:* Thursday, 2 February 2012 7:52 AM > *To:* 'ozDotNet' > *Subject:* Making an application that uses identity keys occassionally > connected**** > > ** ** > > Hi All**** > > I am interested in making my application occasionally connected.**** > > My app uses SQL Server and the tables have identity keys (auto > incrementing numbers) **** > > I can see this will be a problem if I have 2 databases on separate > computers because they will both want to assign a new record to the same > key. **** > > Indeed when I experimented with Microsoft Sync Framework 2, this is what > happened.**** > > Any advice on a strategy forward?**** > > Thanks**** > > Kirsten**** > > ** ** > > ** ** > > ** ** >
