

At this point it is also worthwhile comparing the row count with the new range start value and the item’s maximum possible value to ensure that there will be a large enough replacement value allocation. By their nature, Primary Key values will be unique and when we replace them the safest approach is to replace them with values which are:Īs an example, if the max PK value is 7654321 we could define a replacement range of 8000000 (leaving room for new keys to be allocated in the live application) and incrementing this new start-point by “1” for each key value to be replaced. When building our masking plan, it’s useful to also document row counts (as a snapshot) as well as the key value ranges in the primary table. The task may also call for us to span databases in the server, so we must discover and document this, as well. The first step is to identify those tables and their join columns and detail them in our masking plan. In all instances we need the ability to identify each unique join value and provide a replacement for it across the tables regardless of relationship. It’s also not unusual to find the latter approach is implemented across the data structures and no database relationships (PKFK’s) are implemented! It’s not unusual, however, for there to be other tables which are related to the primary table by application inference and not the database RI.

Stating the obvious, these values are the glue which holds the application data together. It may, as another example, contain a family name such as “SMITH12345”.Ĭhanging PKFK values requires detailed planning. This is most likely because the key value contains PII data, for instance it’s a social security number. Sometimes we have no option other than to change the Primary Key and its associated Foreign Key items. If it’s a numeric value which on its own or in correlation with other items will not identify a person or disclose corporate confidential information the argument can be made to leave it as it is. When deciding whether a PKFK must be changed the first step is to evaluate the data content of the key. How do I change a Primary Key value and all the Foreign Keys associated with it? What if there are key items in other tables which are in an application inferred relationship with the Primary Key?
