Random Autonumber Force Positive Only

tfaiers

Registered User.
Local time
Today, 06:58
Joined
Apr 26, 2002
Messages
54
I don't know if it's possible, but is there any way of forcing the random autonumber generator in tables to be a positive number only?

The autonumber as I've searched on the forum can be a positive or negative number and I'd like to use the random autonumber feature as a primary key for account numbers for my database, but not using the negative numbers as they will look like odd account numbers with the leading negative.

I could possibly remove the leading negative, but there's then the chance that you'll have duplicates.

Thank you!
 
First mistake: If the number is supposed to have some special meaning and a special format, it probably should not be an autonumber.

Autonumbers are in the class of "meaningless" keys. They have certain properties, but monotonic and contiguous increase cannot be guaranteed. If the properties of the autonumber generator don't match what you want to do then autonumbers are not the right solution. Search this forum for the topic of Autonumbers to see lots of discussion for alternatives.
 

Users who are viewing this thread

Back
Top Bottom