My situation is :
- I have a number of client applications, which is using local DB (MS SQL, MS Access – sorry, this is Enterprise system, I have to support legacy…)
- I don’t know anything of trend among clients – now it’s ~10 but it may
be ~100 in a year. - Data from those tables comes to my central server and is put into one common table
- Sometimes existing (client) data is changed – I have to perform update/delete operations
- I don’t want use GUID’s (.NET type
System.Guid) – It’s hard to simply implement and support on MS Access. Besides, it’s not good for performance - I need a fast search on that common table, so it would be nice to use
intorlong intas a PK
So, I want:
- Something unique to avoid collisions (it will be used as a PK)
- It should hopefully be
intorlong int - Must be assignable client-side before being inserted
My current solution is to take the CRC from a concatenation of:
- ProcessodID
- Bios date
- User name (strings, hardware\user related data)
- DateTime.Now (UNC)
Currently it works for me, but maybe there is a better approach to achieve my goals?
Any comments, suggestions, examples, or experience of your own?
UPDATE : synchronization between client and server is periodic action, so it can occurs 2-3 times per day (it’s config variable)
If data from multiple tables comes to one central table and you need to address changes to these records then my suggestion is to use two columns as PK of you central table. One column could be the Identity field from clients (not unique) and one column could be a client code (not unique) assigned by you to your client apps. The aggregate from ID and client code will be your PK
This solution has the advantage to not require any changes on the client side apps (perhaps some identity code to send to your central server where you could use for some security measure)
Of course, if the customer base grows (hopefully) you need to keep a centralized table of code assigned to each client. The search on the central table should not be a problem because you are using two numbers (or short string for the identity code).