You do not specify what the primary key of the table is, so it is impossible to know if you are going to generate a unique key violation. Additionally, you do not clearly state what the business rule(s) are. Finally, from the looks of it, I want to state that this design pattern does not appear to be a best practice. I strongly advise you to provide some context around this as there may be a better way to either structure your data to avoid this or provide the result you are looking for without this update.In any case, I did my best to answer your question:DECLARE @T1 TABLE (ID CHAR(2) NOT NULL,LinkID CHAR(2) NOT NULL,Active BIT NOT NULL,[Date] DATE NOT NULL);INSERT @T1 SELECT 'a1' , 'k1' , 0 , '2014-01-05' UNION ALLSELECT 'g9' , 'k1' , 1 , '2014-02-13' UNION ALLSELECT 'z5' , 'k2' , 0 , '2014-01-01' UNION ALLSELECT 's6' , 'k2' , 0 , '2014-02-17' UNION ALLSELECT 'd7' , 'k2' , 0 , '2014-03-21' UNION ALLSELECT 'd8' , 'k2' , 0 , '2014-04-20' UNION ALLSELECT 'd9' , 'k2' , 1 , '2014-05-02';SELECT * FROM @T1;UPDATE tSET ID = t2.IDFROM @T1 AS tJOIN @T1 AS t2ON t.LinkID = t2.LinkIDWHERE t.Active = 0AND t2.Active = 1AND t.ID <> t2.IDSELECT * FROM @T1;/*ID LinkID Active Dateg9 k1 0 2014-01-05g9 k1 1 2014-02-13d9 k2 0 2014-01-01d9 k2 0 2014-02-17d9 k2 0 2014-03-21d9 k2 0 2014-04-20d9 k2 1 2014-05-02*/