If these numbers should always have the leading zeros, it is better to store them that way in the database using a varchar instead of a numeric datatype. If you must select them often, it is not very efficient to have to cast them and then add the zeros and then cut back to the correct length every time you refer to this field. This type of operation should be done at the point where the record is entered so that it is only done once.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.