Your statement of 'AB' is bit confusing... if following query solves your problem then OK else clarify your statement ..
Main Topics
Browse All TopicsI know this sounds very basic but I would like to update the values in one table based on the values of another. Here's the real case: I wuold like to replace the value of COUNTRY in address table with the value of COUNTRY that is stored against the POSTCODE (or zip code in the US)
so for all the tblADDRESS records with a POSTCODE value of 'AB' replace the current value of tblADDRESS.COUNTRY with the value of POSTCODE.COUNTRY that has an 'AB', then repeat until the end of the table.
I have no idea of how to do this, I can programme a bit but I would be very grateful as I will need this, would it be better in SSIS, with a lookup function?
Many thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thanks for that, the AB was just the first record in the table there 189 other codes with the format of
this view has all the UK postcodes with the country it lies in for example...
COUNTRY POSTOCDE
SCOTLAND AB
ENGLAND B1
ENGLAND B2
WALES CA
etc.
the table I'm trying to update is all the customer address details 3000 records
COUNTRY POSTOCODE
UK B1
UK CA
UK AB
UK B2
EIRE NULL
JAPAN NULL
So what I want to do is for each record in the address table replace the value of UK with the correct correct corresponding country in the postcode view
Hope this helps
Business Accounts
Answer for Membership
by: MuhammadKashifPosted on 2009-10-22 at 04:58:44ID: 25633044
syntax of the update table query based on other table
Select allOpen in new window