Phone Numbers in SQL

  • Hello All

    How is everyone this evening? I hope that you are well.

    My question is, what would be the best data type to use when storing a phone number with No Special characters in SQL 2000?

    ie... 8885551212 or "all international numbers"

    Would "int" be sufficient to cover all ranges of numbers that can be dialed as a valid phone number in the world. Any and all suggesions on this are greatly appreciated. Have a wonderful evening and stay warm.

    Be good, Santa is watching you.

    Andrew

    How long a minute is....

    Depends on what side of the bathroom door you are on.


    How long a minute is....
    Depends on what side of the bathroom door you are on.

  • The problem with using int is it only goes to 2147483647 so 8885551212 will not work at all. You could also try bigint which should cover most all the possible numbers but there are some odd dialing behaviors for international dialing that you need to keep in mind. Of course all international calls from the US start 011 so you will lose the 0, 011 is similar to dialing 1 in the US as it tells the switch the type of call. You may consider using a user defined data type of varchar with a mask of '[0-9][0-9][0-9]... to cover the numbers and not worry about losing your zero, if not worried about saving the 011 for international, the bigint should work. I worked for an LD company before and never saw one larger that bigint would support (doesn't mean cannot happen but I never came across). For additional help on internation dialing check out http://www.consumer.att.com/global/english/consumer_information/dialinginstructions.html# to get country and city codes plus format for numbers (some may not be listed but you can get a list from AT&T by asking for the complete list).

  • Thank you so very much. That was a Great help.

    Andrew

    How long a minute is....

    Depends on what side of the bathroom door you are on.


    How long a minute is....
    Depends on what side of the bathroom door you are on.

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

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