Syntax?


  • I get an error when trying the following - can anyone point out where I am going wrong.

    UPDATE Table2 INNER JOIN Table1 ON Table2.Description = Table1.Description SET Table1.idcreated = Table2.ID

    Err 156 - incorrect syntax near the keyword INNER

    Ta

  • UPDATE t1

    SET idcreated = t2.ID

    FROM Table2 t2 INNER JOIN Table1 t1

    ON t2.Description = t1.Description

    John

  • Put the 'set' before the 'join' and set the table2 column like:

     

    UPDATE Table2 SET Table2.ID = Table1.idcreated INNER JOIN Table1 ON Table2.Description = Table1.Description


    And then again, I might be wrong ...
    David Webb

  • Thanks both of you - my set was in the wrong place - and I needed a from.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply