1
Reply

How many update commands we need to issue to update data in related tables?

Govardhan P

Govardhan P

5y
953
1
Reply

Consider that we have two tables. One parent table assume it has 5 records and, the child table has 10 records. In order to perfom an update of the missing data/values in the child table how many update statements do we need to execute?

    Single update command in join

    Using right join in update query it’s possible, from below example you can work around

    UPDATE Child SET ChildCOl = value
    FROM Child as C
    RIGHT JOIN Paraent as P
    ON C.Col = P.Col
    WHERE P.COL IS NULL