DECLARE @test INTSET @test= 3 --char number from left in string to replaceDECLARE @newValue AS CHAR(1)SET @newValue = 'X' --new value for replaced textDECLARE @inputText AS VARCHAR(10)SET @inputText = 'ababababab'SELECT CAST(SUBSTRING(@inputText,0,@test) AS VARCHAR) + @newValue + CAST(SUBSTRING(@inputText,@test+1,LEN(@inputText) - @test) AS VARCHAR) --RESULT 'abXbababab'