Ver originalSELECT replicate('0',7-len(rn)) + rn AS cadena, nombre FROM(SELECT ROW_NUMBER() OVER (ORDER BY NOMBRE) rn , NOMBRE FROM ALUMNO) AS t1