Hi!
I'm developing a project in which I have several Sql Server Express and
Sql Server Mobile 2005 databases and all of them are subscribed to a
central Sql Server 2005 database.
Now, I'm in trouble with the primary keys because if i insert two
registers with the same primary key in two different subscribers, when
the record is merged to the publisher, there is a primary key
collision.
I'm studying two different solutions:
A) Assign ranges of primary keys in each subscriber in order to assign
different IDs in each subscriber
B) User GUID as primary keys, so each primary key will be diferent.
Which are the pros and cons of each solution? Do you think one is best
than the other? Will I have performance problems using GUIDs in a Sql
Server Mobile database?
Thaks in advance!
Jordi
Guid's don't perform as well as int identity. If you use the
newsequentialid() property you will get sequential guids but although
fragmentation is reduced you still don't get the performance of a int data
type.
Your choices are to extend your primary key to include a location identifier
or implement automatic identity range management.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
<jordics@.gmail.com> wrote in message
news:1166626358.727257.205170@.t46g2000cwa.googlegr oups.com...
> Hi!
> I'm developing a project in which I have several Sql Server Express and
> Sql Server Mobile 2005 databases and all of them are subscribed to a
> central Sql Server 2005 database.
> Now, I'm in trouble with the primary keys because if i insert two
> registers with the same primary key in two different subscribers, when
> the record is merged to the publisher, there is a primary key
> collision.
> I'm studying two different solutions:
> A) Assign ranges of primary keys in each subscriber in order to assign
> different IDs in each subscriber
> B) User GUID as primary keys, so each primary key will be diferent.
> Which are the pros and cons of each solution? Do you think one is best
> than the other? Will I have performance problems using GUIDs in a Sql
> Server Mobile database?
> Thaks in advance!
>
> Jordi
>
No comments:
Post a Comment