@Jayakumar,
Is this what you are looking for
declare @t table (sr_no int identity(1,1),name nvarchar(200),num nvarchar(200))
insert into @t VALUES('AA', '852497'),('BB', '258'),('CC', '6597'),('DD', '9747587'),('EE', '788501')
select *, ValueToUpdate = replicate('1',len(num))
from @t
/* Result */
sr_no name num ValueToUpdate
1 AA 852497 111111
2 BB 258 111
3 CC 6597 1111
4 DD 9747587 1111111
5 EE 788501 111111
For updating the records, use
update @t
set num = replicate('1',len(num))
/* Result */
sr_no name num
1 AA 111111
2 BB 111
3 CC 1111
4 DD 1111111
5 EE 111111
--
Thanks & Regards,
RNA Team
Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator