• Phil Parkin (8/29/2012)


    Luis Cazares (8/29/2012)


    It should be char or varchar.

    Ideally you should only store the digits and format the phone in the front end. However, you'll need an extra field for extension if needed.

    I can imagine international numbers introducing difficulties to this solution (different display formats, therefore need to parse the country code first in a separate column etc etc).

    I'd stick with varchar & use suitable constraints and front-end validation to stop rubbish getting in there.

    Display format should be defined for each user, not each phone. If managing international numbers, there should be a column designed for it. I'll prefer to store just the digits and probably in separate fields (according to the different attributes) to allow easy formatting. For me a phone number could be a composite attribute or even an entity, however it can be handled as a simple attribute.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2