I have received few emails asking how to prefix any number with zero. I have previously written two articles for the same subject. Please refer to my previous articles. Both show how to add a leading zero to a number for fixed width display.

SQL SERVER – Pad Ride Side of Number with 0 – Fixed Width Number Display
SQL SERVER – UDF – Pad Ride Side of Number with 0 – Fixed Width Number Display
Let me know if you are aware of any other method.
Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.




