We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Key code situation

Medium Priority
245 Views
Last Modified: 2010-04-23
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
Comment
Watch Question

CERTIFIED EXPERT

Commented:
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 Developer

Author

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 Developer

Author

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
CERTIFIED EXPERT

Commented:
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 Developer

Author

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 :)
Commented:
Closed, 250 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.