If you want to pad numeric values with leading zeros use the following line.
Change the number “3” to the length of the string you need.
SELECT REPLICATE('0', 3 - LEN(numeric_field)) + CAST(numeric_field as varchar)
Knowledge Base for IT Professionals, Teachers and Astronauts
If you want to pad numeric values with leading zeros use the following line.
Change the number “3” to the length of the string you need.
SELECT REPLICATE('0', 3 - LEN(numeric_field)) + CAST(numeric_field as varchar)