General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Another approach: assign to each computer or system a unique ID (with a 2 character ID mixing numbers and lower case letters you can have 1296 different keys). Then append this ID to the 2 character TableID that you mention and you have unique IDs across systems. Your only problem to ensure uniqueness is to ensure that TableID is unique in that system, and that no two systems can have the same ID, which is not difficult.
This way you have two advantages: keys keep short, which improves speed in queries, and you know what system generated which record (same as having a systemID field).
HTH,
Javier.
>I can't find anywhere that anyone has done this, though I'm certain that you all have.
>
>I have a 2 character TableID.
>I have a datetime value.
>
>I would like to combine those together and somehow covert that into a unique Primary Key value 16 characters. Should I just concatenate the two?
>
>[AA]+ttoc(datetime(), 1)
>
>Will that assure uniqueness across various systems that will not be sharing a table from which they can pull the next available number?
>
>
>Thanks for your comments.
>
>DJ
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only