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

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?

By Govardhan P in SQL Server on Nov 28 2019
  • Swapnil
    Jul, 2020 4

    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

    • 1


Most Popular Job Functions


MOST LIKED QUESTIONS