1 2 3
| PRINT RIGHT(CAST(REPLICATE('0', LEN(no_start)) + CAST(no_start + (inventory - 1) AS VARCHAR(50)) AS VARCHAR(50)), LEN(no_start))
PRINT RIGHT(CAST(REPLICATE('0', LEN('000001')) + CAST('000001' + (50 - 1) AS VARCHAR(50)) AS VARCHAR(50)), LEN('000001'))
|