Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replica Database and Autonumber Problems

Status
Not open for further replies.

jestrada101

Technical User
Mar 28, 2003
332
I have a replica database that is populating an "autonumber" field with extrmely large numbers. It was originally populating with low numbers, but now is giving me large numbers and sometimes negative numbers?

Any ideas??

Thanks
JE
 
This is standard behaviour for Replicas.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Is there a way to reverse the behavior?

Thanks
Jose E
 
No.

When you convert a stand-alone database to replica with master, all autonumbers are converted from serial / sequential numbers to random numbers. This is a good thing.

Since the databases operate separately, and the three replicas grab the next autonumber, 1000. You will have write contentions when synchronizing the databases, and you will only be able to store one of the three records.

As a side comment, the autonumbers should not have any meaning to the user. They are used only for assigning unique references for a record, and as foreign keys when linking tables.
 
This customer is using the ID as product id number, and I'm assuming somehow they did a replica without really knowing it's impact. They assumed it would simply create them a backup. Now, the autonumber go up into the 100 thousands.. and sometimes gives a negative number. Is this normal behavior of the feature?

 
Do you / they have a back up?

Once the replica has change autonumbers to random, the process can not be reversed directly. You can create a new field, and make it an autonumber (sequential / serial).

Trying to get the new autonumber to replace the links to related tables may be a major piece of work.

An autonumber is a long interger. The serial number will be positive, but the random number can range from...
–2,147,483,648 to 2,147,483,647 (32 bit number).

The Ten Commandments of Access
See #7

In hind sight, the autonumber should only be used to uniquely identify the record.

Richard




 
Thanks All... I will have to verify to see if they have a backup.

Otherwise, as you mentioned, there will be quite a bit of work.

Thanks again!

JE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top