Firstly, I know this question , and the sentence (using the GUID) is not applicable in my situation.
I want simple UIDs so that my users can easily transfer this information over the phone:
Hi, I have a problem with order 1,584
Unlike
hi, I have a problem with ordering 4daz33-d4gerz384867-8234878-14
I want them to be unique (wide database), because I have several different “objects” ... there are order identifiers, delivery identifiers and billing identifiers, and since there is no one-to-one relationship between them, I cannot guess which object the identifier belongs to.
Thanks to the unique identifiers of the entire database, I can immediately tell which object my client belongs to. My user can simply enter the identifier in the search tool, and I save it for an additional click to clarify what I'm looking for.
My current idea is to use identifier columns with different seeds 1, 2, 3, etc. and the increment value is 100.
This raises several questions:
What if in the end I get more than 100 types of objects? that I could use 1000 or 10000, but something that does not scale well "smells"
Is it possible that the seed is “lost” (during replication, database problems, etc.?)
In general, are there other issues that I should be aware of?
Is it possible to use a non-integer (I am currently using bigints) as identifier columns so that I can prefix the identifier with something representing the type of the object? (e.g. varchar column)
it would be a good idea for the user to have a “main table” containing only an identifier column, and possibly an object type, so that I can just insert a row into it when a new idea is needed. I feel this might be a bit too much, and I'm afraid it will get all my insertion requests out of the way. Plus, the fact that I can not determine the type of object without looking at the database
Are there any other smart ways to solve my problem?
sql database sql-server identity database-design
Brann Apr 6 '09 at 13:41 2009-04-06 13:41
source share