@manhng

Welcome to my blog!

SQL SERVER FORMAT NUMBER

February 1, 2020 12:08

SELECT RIGHT('0000000' + CAST( 1 AS VARCHAR(7)), 7)
UNION ALL
SELECT RIGHT('0000000' + CAST( '103' AS VARCHAR(7)), 7)
UNION ALL
SELECT RIGHT('0000000' + CAST( '1030' AS VARCHAR(7)), 7)

Categories

Recent posts