I have a set of employee numbers ranging from 3-5 characters and need to pad them starting with a 1 and fill in the remaining space with zeros so they are 6 characters long. Ive used
SELECT LEFT('100'+ CONVERT(VARCHAR,EMPLOYEE),6) AS NUM FROM ls_apps.EMPLOYEE
which works fine until the numbers have 4 or more characters already.