My strongest arguments for creating ID's or using GUID's are as follows:
If you are planning on merging or replicating data from two different
datasources you can not use autonumber.
If you have heavy transactional volume, autonumber will get corrupted from
time to time ( a real pain ).
Makes Parent/child entries easy since you already have the identity value,
there is no need to process "select where insert = last"
Since these ID's are internal to the system does not matter what they look
like.
Since these ID's remain constant allows you to give the user flexibility in
assigning lookup values.
Since we do replicate data between RBase and SQL Server we created an Stored
Proc to generate our unique numbers for us. Works great, but they are not
really random, and neither are GUIDs.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Bob Powell
Sent: Monday, April 23, 2001 2:26 PM
To: [EMAIL PROTECTED]
Subject: Random numbers continued
Ladies and Gentlemen:
I see I have instigated a large discussion on
random numbers. Let me explain where this is coming from.
I have a DBA that feels id numbers which link the
various database files together should be random in nature.
I explained that R:base has its own way of
automatically generating consecutive numbers which
guarantees uniqueness. I also feel that allowing R:BASE to
generate the number automatically in the table is better
than having to write application code to do it. As we all
know this is a must and R:Base's solution is just fine with
me.
She feels however that random generating a
unique id number is a better way to go although I am hard
pressed to have her explain to me why. So I just wanted to
know if someone had done something I have never been able
to do.
Having taken PASCAL 100 years ago I agree with the
idea that a random generator will eventaually repeat a
number. I was taught that a random generator should in
fact repeat the same sequence if the same seed is used.
Somethimes for testing being able to generate the same
random sequence is good. At other times it is not, but it
seems to me that as long as you change the seed the random
sequence should be different which I think is what you all
have discovered. This seems perfectly acceptable to me if
I remeber my training years ago.
Based on the way I understand random generators in all
languages R:BASE's is responding correctly. I think what
we all are discovering is that there is not way to randomly
generate unique numbers. This is OK with me since I feel
the unique consective numbering allowed in tables works
just dandy.
Maybe I need to explain to her that sometimes database
theory needs to be over-riden by practicality. She has it
in her notes from one of her database instructors that
random generated id numbers is a good thing.
----------------------
Bob Powell
The Hotchkiss School
Lakeville, Connecticut
Systems Administrator
[EMAIL PROTECTED]