Smarter update possible

  • We have the following situation.....

    Update TableA Set

    Field1 = (select Anotherfield1 from tableB where ID = 1)

    Field2 = (select Anotherfield2 from tableB where ID = 1)

    Field3 = (select Anotherfield3 from tableB where ID = 1)

    (etc etc..... fone for approx 14 fields)

    We cannot execute a stored procedure and the query has to handle this in one go........

    Is there anybody out there who knows a better way ?????

  • Try

    
    
    UPDATE TableA SET
    Field1 = tableB.Anotherfield1,
    Field2 = tableB.Anotherfield2,
    ...
    FROM
    tableB
    WHERE tableB.ID = 1

Viewing 2 posts - 1 through 1 (of 1 total)

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