Leading Zeros

  • New to SQL Server but... Am I missing something or is it impossible to create any type of numeric column that will support leading zeros?

  • To have a number with leading zeros you'll need to define the field as char or varchar.

    Are the leading zeros required for a genuine business need, or just display purposes?

    If you just need to display the number with leading zeros, I'd store the data without the zeros and then have the presentation layer add them when displaying the record.

    Thanks

    Phill Carter

    --------------------
    Colt 45 - the original point and click interface

  • Thanks Phil,

    I'm taking feeds from different sources (several different database engines). The leading zeros come to me in several different columns and must be maintained to keep in synch with those other databases. So it's not just a display issue.

    Thanx,

    Wally

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply