UPDATE
  taClientBranchProducts
SET
  ConsultantID = @nParentConsultantID,
  SalesReferrerID = @nParentSalesReferrerID,
  SalesCloserID = @nParentSalesCloserID,
  TechnicalSpecialistID = @nParentTechnicalSpecialistID,
  JoinDate = @aParentJoinDate
WHERE
  (ClientBranchProductID IN (
    SELECT
      BP.ClientBranchProductID
    FROM
      taClientBranchProducts AS BP
        INNER JOIN taClientProducts AS CP ON (CP.ClientProductID = BP.ClientProductID)
        INNER JOIN taClientProducts AS P1 ON (P1.ClientProductID = CP.ParentClientProductID)
        INNER JOIN taClientBranchProducts AS P2 ON (P2.ClientProductID = P1.ClientProductID)
    WHERE
      (BP.Status = 1) AND
      (P2.Status = 1) AND
      (P2.ClientBranchID = BP.ClientBranchID) AND
      (P2.ClientBranchProductID = @nParentClientBranchProductID)
  ))
