SQL Server – Formatting Numbers as Strings with Leading Zero’s
Sometimes it’s necessary to format numbers as Strings with leading zero’s. One such example is when we sort a list in Excel, Excel will sort the numbers as 0,1,10,2,20,3,30,….. So, to get round this, we simply append a leading 0 to the number. This is achieved in T-SQL by using the RIGHT instruction with following [...]