BEGIN declare @i int set @i= (select COUNT(id) from dbo.tb_ErpCustomer) while @i>0 begin UPDATE [dbo].[tb_ErpCustomer] SET [Cus_Birthday] = CONVERT(varchar(100), CONVERT(datetime, Replace([Cus_Birthday],'A','')), 20) set @i=@i-1 end END