I'm repeatedly surprised by how people go off answering without any idea
about why someone want something. The "identity column" replies assume (I
don't see you mentioning it) that you intend to use this as an ID of some
sort. And furthermore that "unique to the table" is good enough.
What do you want these things for? Clearly you know there is "a way" to
create 10-character alphanumeric strings and you must realize that
uniqueness can only be insured by testing whether the string you generate is
a member of a set of strings you generated in the past.
A GUID while not "guaranteed" to be unique is considered unique (across the
universe) due to it's huge range of values. If you can generate several
billion and not get a duplicate then we're in the odds of being hit by
lightning "in the next minute" sort of area.
The way you can guarantee a unique 10-character sequence is to generate all
10-character sequences and then allot them as needed. Regardless of the
mechanism you use to do it simply mark each one as "used" as you use each of
them. Now you have a unique value, a total number of unique values, the
total number of unique values and (if you care to enhance the system) the
rate at which you consume values.
Tom
"Robert Mago" <ro****@mago.comwrote in message
news:u8**************@TK2MSFTNGP03.phx.gbl...
Is there a way to create a 10 characthers or less, alph-numeric string
which is unique. I can't use the guid since its longer then 10
characthers. Also i cannot use a random number, since being random does
not mean that its unique.