I'm trying to rename a primary key in a table by creating a new batch report. For instance, the original name of the first Entry No. is 10, I want to make it 1.
Can anyone help me how to achieve that?
1. Create a holding table for the data. This should be a copy of the original table. It can be a temporary or real table.
2. Copy the records to this holding table while deleting from the real table.
3. Copy back to real table and update the primary key values before inserting,
1. Create a holding table for the data. This should be a copy of the original table. It can be a temporary or real table.
2. Copy the records to this holding table while deleting from the real table.
3. Copy back to real table and update the primary key values before inserting,
Take care with relations! E.g. the G/L entry PK is also stored in the "G/L Entry - VAT Entry Link" table, so you will also have to change all entry numbers in related tables
Answers
2. Copy the records to this holding table while deleting from the real table.
3. Copy back to real table and update the primary key values before inserting,
As mentioned above, you do need to pay attention to any table relations.