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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace data in a table with what's in an Excel file

Status
Not open for further replies.

JEngles

MIS
May 21, 2003
93
AU
The plan is to use an excel file with column A being what’s in the database table and Column B with whats to be replaced.

Can someone please tell me how might go about doing something like this??

Thanks in advance
 
If this is one time job, I'd export the Excel file into a temp table first (using Import/Export wizard, for example) and then do update by joining with that temp table.

PluralSight Learning Library
 
Assuming this is a long term or repeated process, I'd suggest adding a little more structure to your file.

Something like
Columns
TableName
PrimaryKeyColumn
PrimaryKeyValue
UpdateColumnName
UpdateColumnValue

Note the UpdateColumnName/Values are repeating.

Though the obvious question is why aren't you just updating the database directly...

Lodlaiden


If [blue]you have problems[/blue], I want [green]source code[/green] AND [green]error messages[/green], none of this [red]"there was an error crap"[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top