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 [...]

By | 2011-03-03T12:46:00+00:00 March 3rd, 2011|Data, Excel, SQL Server, VB.net|0 Comments