>>If we're not careful and there is no direct relationship (1 to 1) between table we're updating and a second table, we may end up updating wrong data.
>
>So, when using an alias, such as the first example I showed, is this considered direct relationship? If yes, then, this would mean using alias, such as in that example, is safe. Can you confirm that?
No, what I mean is this
Orders
OrderDetail
Update O set OrderQty = OD.Qty
from Orders O
inner join OrderDetail OD
on O.OrderID = OD.OrderID
In this case one Order has multiple OrderDetails records. Using the update I showed (perfect syntax), we don't know what we will end up with since one record in Order table corresponds to multiple records in the OrderDetails.
If in your update you can guarantee, that each record you're updating has one (or 0) corresponding records in the other table, then you should be OK.
If it's not broken, fix it until it is.
My Blog