Update Table using field from another table

  • Can someone show me how to update a table with a field from another table. I have a field to match.

    Pseudocode:

    Update the id field on TableA with the id field from TableB.

    Join the tables using xCode on both tables.

    Only update records on TableA when the id is blank.

    Thanks in advance for your time.

  •  UPDATE TableA
    
    SET id = TableB.id
    FROM TableA
    INNER JOIN TableB ON TableA.xCode = TableB.xCode
    WHERE TableA.id IS NULL OR TableA.id = ''


    Cheers,
    - Mark

  • Thank You

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

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