Take a look at example:
DECLARE @tmp TABLE(PersId INT, PersonUID VARCHAR(9) PRIMARY KEY, PersonnelName VARCHAR(30))
INSERT INTO @tmp (PersId, PersonUID, PersonnelName)
VALUES(137, '01066141L', 'PREM SINGH'),
(128, '02679425F', 'RADHAKRISHANAN'),
(129, '1066141L', 'PREM SINGH'),
(130, '04457802P', 'MOTI SINGH'),
(135, '2365847P', 'Ramesh')
UPDATE t1 SET PersonUID = RIGHT('000000000', 9-LEN(t1.PersonUID)) + t1.PersonUID
FROM @tmp AS t1 INNER JOIN
(
SELECT PersId, PersonUID, ROW_NUMBER() OVER(PARTITION BY RIGHT('000000000', 9-LEN(PersonUID)) + PersonUID ORDER BY LEN(PersonUID) DESC) AS PID, PersonnelName
FROM @tmp
) AS t2 ON t1.PersId = t2.PersId AND t2.PID = 1
SELECT *
FROM @tmp
Result:
137 01066141L PREM SINGH
128 02679425F RADHAKRISHANAN
129 1066141L PREM SINGH --skipped
130 04457802P MOTI SINGH
135 02365847P Ramesh --added leading zeros
I hope that above example is helpful in understanding how to update your data.
[EDIT]
I have used
ROW_NUMBER()[
^] function to detect which record is duplicated.
ROW_NUMBER()
function returns the sequential number of a row within a partition of a result set, starting at 1 for the first row in each partition.