1
I have a table Produto (id, descricao, tipo)
and that same table is on three different computers.
All three write data to your machine and from time to time send the data to a server.
What happens is this: let’s say PC1 and PC2 record data in the table:
PC1-
1, produto1, tipo1
2, produto2, tipo2
3, produto3, tipo3
PC2-
1, produto4, tipo4
2, produto5, tipo5
3, produto6, tipo6
When the data is sent to the server, it will be +- like this:
1, produto1, tipo1
2, produto2, tipo2
3, produto3, tipo3
4, produto4, tipo4
5, produto5, tipo5
6, produto6, tipo6
This data will be downloaded by all other Pcs to update to their local banks, and confusion will be generated with the Ids. Ex:
in the product PC14 will have ID 4
in PC2 product will have ID 4
My question is: Is there any possibility of a ID being generated that will not be repeated?
Tip: use a GUID
– Jéf Bueno
If at some point it will work offline there is no way. I created a unique id for each input and when updating, use this id as a reference. It’s the only way possible.
– caiocafardo