Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

import from excel and upate a SQL table

Status
Not open for further replies.

mbair

Programmer
Aug 13, 2003
22
US
I have 2 columns in an excel spreadsheet. I want to match the first column to a (primary key) column in a SQL table and then update the field in the table with what's in the second column of the excel spreadsheet. Is there a way to do this and what is that way???
 
Import the spreadsheet into an alternate, temporary?, table rather than you want to update and use an UPDATE statement with a where clause matching data between your Primary Key field in the table you're updating and the appropriate field in tha table holding the excel data.

Rhys
"There are some oddities in the perspective with which we see the world. The fact that we live at the bottom of a deep gravity well, on the surface of a gas-covered planet going around a nuclear fireball 90 million miles away and think this to be normal is obviously some indication of how skewed our perspective tends to be"
DOUGLAS AD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top