UPDATE t1
SET t1.IdTwo = (SELECT top 1 t2.IdTwo FROM TableTwo t2 WHERE t2.IdOne = t1.IdOne AND t2.Active = 1)
FROM TableOne t1
1
solved Update value of row based on result from another table SQL Server
UPDATE t1
SET t1.IdTwo = (SELECT top 1 t2.IdTwo FROM TableTwo t2 WHERE t2.IdOne = t1.IdOne AND t2.Active = 1)
FROM TableOne t1
1
solved Update value of row based on result from another table SQL Server