|
Posted by Aggro on October 9, 2005, 1:23 pm
Please log in for more thread options
Phil Latio wrote:
> Have a database that records data taken in the field and was using an
> "auto_incremented" integer. I now want to distribute the database to others
> so they can record data then centralise all the data on one database so
> people can share records.
There are few ways to do this:
- If you don't need to know what the id was on distributed computer,
just ignore it and assign a new id for it.
- Or add new id to identify source location. Then combine the remote id
with location id and you should have combination which would not only be
unique, but would also allow you to locate the source for given row
quite quiqly. ( It is recommended to add new table also, where are at
least two fields, id and name. ).
> However will an "auto_incremented" integer on it's own won't suffice? I
> suppose it might if that field didn't have to be unique but is that best
> practice? I was thinking along the lines of creating a unique field by
> combining for 3-4 fields such as time, date, member and "auto_incremented"
> integer.
While this would most likely never cause problem, there would still be
possibility that at some point two users would create exactly the same
row and it could cause problems. So I suggest you not to use this.
|