Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)
Trying to update CTE2 Table5 after CTE1 Table1 is updated. Gives error.
;WITH CTE1 AS ( Select Table1.row1, Table1.row2, Table1.row3, Table2.row1 from Table1 left Join table2 on table2.Id = table1.Id ) ,CTE2 AS ( Select Table5.row1, Table5.row2,Table5.row3,Table5.row4 from Table5 ) Update CTE1 set Table1.row1=Table5.row1 ,Table1.row2=Table5.row2 ,Table1.row3=Table5.row3 ,Table5.row4=1 FROM CTE2