PK Long Integer vs Replication ID

calvinle

Registered User.
Local time
Today, 04:10
Joined
Sep 26, 2014
Messages
332
Hi,

I have a database that I want to track every changes on the database and over years. I have seen from Allen Brown a code to audit track the changes of records that user make to the database. However, I am wondering what is the limit of the PK long integer over year? Is it safer to use Replication or Long Integer should be fine?

Just worrying too much?

Thanks
 
long integer is a 4 byte integer, which can hold a maximum value of approx. 2billion.

replication ID is a 16 byte guid, and are intended for special use in dbs where the same database is located in 2 or more locations, and requires to be merged at a later date. The replication id becomes random, to try to ensure that the same value will not be issued at different locations.

the replication ID PK is not what you need to audit changes. What you need is a second table to track the changes you make to records, or more likely certain fields in records.

So given record with ID 1, you need to store details of changes to the record. The record key is still ID 1, but the changes will be datestamped, for instance, so you can see a history of changes oldest to newest.

https://en.wikipedia.org/wiki/AutoNumber
 
Great! thanks for the information.
 

Users who are viewing this thread

Back
Top Bottom