Question

What would be the best Data Type to use for storing an MSISDN (phone number).

Need to be able to store any phone number in the world.

Does anyone know the maximum possible MSISDN length, including international dialling code?

For example South Africa phone numbers are +27xxxxxxxxx which results in 11 digits excluding the +

The + does not have to be stored.

Thanks in advance

Was it helpful?

Solution

I'd use BIGINT. Please avoid using varchar at all costs. It's a very bad idea to use varchar or char.

Reasons. Varchar/char takes up more space, it's slower to do lookups and cross references and the index is larger too.

When designing tables try and keep them with set row lengths, things will run loads faster. If you have to have some text field it is often best to use char instead of varchar as the overhead cost of varchar is high.

Am working in telecoms for 12 years now designing/optimizing VoIP/SMS platforms. The number one killer when I come in to fix systems is varchars everywhere.

Just my 0.02 worth.

OTHER TIPS

A MSISDN is limited to 15 digits, prefixes not included.

MSISDN in the GSM variant is built up as:

MSISDN = CC + NDC (or NPA ) + SN
CC = Country Code
NDC = National Destination Code
NPA = Number Planning Area
SN = Subscriber Number

You ideally do not have to save the +. It simply represents an exit.

The longest international dialling code would only be used when making calls with a Thuraya, which is 882 16. You can have that saved else where.

If you are planning to combine the International dialling code and MSISDN, you can use a nvarchar(21) or varchar(21).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top