Random Primary Keys - messes up Patient numbers

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
drawab
Posts: 46
Joined: Tue Apr 01, 2008 4:57 am

Random Primary Keys - messes up Patient numbers

Post by drawab » Tue Oct 13, 2015 4:54 pm

Hi

I was hoping to install Replication servers (due to horrible internet connections situations) - having set up the process - i turned on Random Primary Keys - and the new assigned patient numbers is jumping all over the place - what used to be a human readable chronologic order of 5 digit XXXXX has now jumped to 19 digits patient number being allocated to each patient for example (8373611305246530320) and each subsequent number on another numerical planet altogether - is this expected? in such a situation

Thanks

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Random Primary Keys - messes up Patient numbers

Post by jsalmon » Wed Oct 14, 2015 7:05 am

That's exactly what random primary keys is designed to do. It allows you to designate ranges of keys to use for each of your servers (that are replicating) and then randomizes new PKs within those ranges for new entries to avoid collisions.
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

Post Reply