Key code situation

Hi,

   I have an application that have many many tables with data all references by a code key for example the passport number, What i need from you is some idea to confront with the next situation.


   If a person comes tomorrow and tell me that that passport number is incorrect how can i do to chane the reference to that person with the less work popssible.

  For example creating a duplicate record in the main table refering the old pasport numberand the new one.

The best idea get the reward :)
Thanks
LVL 13
Alfredo Luis Torres SerranoASP .Net DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mikal613Commented:
I would have 2 Columns holding the info

UniqueID - Which holds the Identity (increments with each number)
PAssportID - An ID thats changeable

OF course through your whole program you will use the UniqueID but for the Interface you will show the PassportID
Alfredo Luis Torres SerranoASP .Net DeveloperAuthor Commented:
Yes bu the problem here is that i have data that i need to be refereced to the new passprt id, that is i have a lot of documents with the old ID. How do my interface will now that the old documents belong to the same person?
Alfredo Luis Torres SerranoASP .Net DeveloperAuthor Commented:
Never mind forgot that, The problem is that i have a lot of tables referenced with the document number´'Passport id' and a table with the unique id and the passport and other tables that mae reference to the id.

How can i change the passport without having to change all the tables
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Mikal613Commented:
you would have to create a Batch Utility where you would go through all the tables and change the id

Update Tablename set PassportID = (Select UniqueID FROM MasterIds WHERE PID = PassportID)
Alfredo Luis Torres SerranoASP .Net DeveloperAuthor Commented:
Thanks mike but i found the correct solution that was.


     Duplicate the master record with the new passportid hold in a var the old passportid, the new one and the id assigned to it, later i will replace in the conextion table the id with the new passportid.

Godd Hunt :)
GranModCommented:
Closed, 250 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.