SQL SERVER – Leading Zero to Number

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 - Leading Zero to Number

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.

SQL Function, SQL Scripts
Previous Post
SQL SERVER – FIX : Error: 18486 Login failed for user ‘sa’ because the account is currently locked out. The system administrator can unlock it. – Unlock SA Login
Next Post
SQL SERVER – List All the Tables for All Databases Using System Tables

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.