- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsI have an Excel sheet looks like this:
PartID MinQty MaxQty
Par1 10 20
Part2 15 20
Part3 20 30
I need to update this to database like:
PartID Warehouse MinQty MaxQty
Part1 USA 0 0
Part1 USA 0 0
Part2 .............so on....................
Part2
Part3
I used below and worked, but I only can do this by one by one.
>>update tabl set minqty='10', maximumqty='20'
>>where partID='part1' and warehouse='USA'
Is there any way I can do this in batch?
I do not mind hand crafting Excel to txt etc.
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: BillBachPosted on 2008-06-16 at 14:05:02ID: 21797490
Easiest way is to use a full-fledged ETL (extract/Transform/Load) tool, which could read Excel directly and update your records with the needed data. I have used Pervasive's Data Integrator to do this (and I know that it could do it directly after about 5 minutes work), but this is a paid solution. Might also be able to do with open source solutions Pentaho or JasperSoft.
Otherwise, the next best option is to save the Excel as CSV, then write a parser that parses the text and changes it to UPDATE statements, then run all the statements through to the target database.
Might also be able to write a SQL query to the Excel/ODBC data source and have IT craft the statements for you, but this would be a bit more complicated to set up.
If this is a one-time thing, I'd recommend the latter two options. If you'll need to do this on an ongoing basis, I'd recommend an ETL tool for the job.