Masking PK with double columns and its referenced tables
Sallesg
Posts: 7 New member
Hi,
My parent table has a double column Primary Key. The child tables also have the columns as a Foreign Key but doesn't have the PK on them, which it would be the same as the FK. The child tables have lots of monetary fields. The structure is something like
Years ParentTable Child 1 Child 2
- idYear - PK - id - pk - id - FK - id - FK
- FiscalYear - idYear - pk - FK - idYear - FK - idYear - FK
- name - value 1 - value 3
- dob - value 2 - value 4
Instead of masking field by field (there are really lots of them), I though of suffleling both fields together to keep the integrity of PK/FK.
I tried to use sync manager but it caused a PK violation, since it changed only one field of the PK.
Since shuffle is for one field at the time, and I have a double PK on one table and no PKs on child tables, I thought of suffle the ID and add a WHERE clause for each idYear, but this will require all to update manually, since new years will be added.
So, in general, how do I mask a double PK in the parent table without messing up the child tables, which have a Fk to the parent table?
I know its a very particular case and I hope were able to proper explain the scenario, but id anyone has an idea of how to do that, I would really appreciate.
Thanks
My parent table has a double column Primary Key. The child tables also have the columns as a Foreign Key but doesn't have the PK on them, which it would be the same as the FK. The child tables have lots of monetary fields. The structure is something like
Years ParentTable Child 1 Child 2
- idYear - PK - id - pk - id - FK - id - FK
- FiscalYear - idYear - pk - FK - idYear - FK - idYear - FK
- name - value 1 - value 3
- dob - value 2 - value 4
Instead of masking field by field (there are really lots of them), I though of suffleling both fields together to keep the integrity of PK/FK.
I tried to use sync manager but it caused a PK violation, since it changed only one field of the PK.
Since shuffle is for one field at the time, and I have a double PK on one table and no PKs on child tables, I thought of suffle the ID and add a WHERE clause for each idYear, but this will require all to update manually, since new years will be added.
So, in general, how do I mask a double PK in the parent table without messing up the child tables, which have a Fk to the parent table?
I know its a very particular case and I hope were able to proper explain the scenario, but id anyone has an idea of how to do that, I would really appreciate.
Thanks
Tagged:
Answers
The help documentation listed below, only has examples for a PK of one column and not multiple columns. They may provide some assistance to you, as the steps to take will be identical or similar for multi column PKs:
Sync Manager Rules
Change a PK value and all associated FKs
FK Refresh Rules
You will need the Sync. Manager rule on each of the Child tables, as a substitution rule requires a PK.
Otherwise, this subject will require a support ticket to investigate further as the subject is too complex to handle via this forum.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
Thanks for the reply. Indeed, my scenario is very particular and I have just found an even more complex detail.
I'll take a deeper look into the documentation and contact the support.
Thanks once again.
Happy New Year