above syntax assumes cust table has a field called "rate", and your new table "NewRate" has a field called "NewRate"
Main Topics
Browse All TopicsHi Experts,
I have an existing master table CUST with 1000 records. Each customer has its own rate which changes periodically and needs to be updated accordingly on the master table. Sales department will give me an Excel file with two fields Cust_no, Rate for those customers requiring rate change.
I know in VFP, I will do the following:
1. convert the Excel file to a .dbf file (NewRate.dbf)
2. SET RELATION TO Cust_no INTO NewRate
3. REPLACE ALL frate WITH NewRate.rate
Can you tell me how to accomplish the above in SQL?
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.
Business Accounts
Answer for Membership
by: gohordPosted on 2009-11-05 at 08:34:18ID: 25751180
1. Right click on target database and select "Import Data"
2. Use the SQL Server Import Export Wizard to import the Excel Spreadsheet into a new table
3. Use the following query to view what would be updated by joining the new table to the existng CUST table:
select * from cust
left outer join newRate on newRate.custno = cust.custno
If that works and you like the results, you can update the soruce table using syntax like this:
update cust
set [rate] = NewRate
from cust
left outer join newRate on newRate.custno = cust.custno