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

Insert INTO / Update Columns

Status
Not open for further replies.

benjatado

Programmer
May 15, 2005
52
US
I am trying to insert new values into an established table. However, each time I try to do this it just appends the values at the end of the table. I need to be able to do something like the following...
Code:
Insert INTO ImageFile.HiResPath
SELECT    HiResPath
FROM         ImageDIR
WHERE ImageFile.ItemNumber = ImageDIR.ItemNumber
But this will not work... I need to make sure that I enter the correct new values within the appropriate row by ItemNumber.
Maybe Insert Into is not what I need for this??... but UPDATE wants to see a 'value' which the values only exist within an excel sheet and there are 3000 some values to be inserted.
Please help! [3eyes]
 
You need to do something like:

UPDATE ImageFile a
SET a.HiREsPath = b.HiResPath
FROM ImageFile
INNER JOIN ImageDir b ON a.ItemNumber = b.ItemNumber
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top