ADMIN_PhoneNumber_FormatAsE123

 Show all Hide all

Deprecated.

This function takes a phone number and formats it in accordance with world standard ITU-T E.123.
If the supplied phone number has a leading plus (+) character then the number will be formatted as an international number, otherwise as a national number.

If a default country code is supplied then all numbers will be formatted as international numbers regardless of original format.

Note: Only phone numbers deemed valid by the function dbo.ADMIN_IsValidPhoneNumber are guaranteed to be formatted correctly.

Type: Scalar function
Area of use: General use

Return value: varchar(50)

A formatted phone number.

Parameters:

@PhoneNumber mandatory varchar(50)
The phone number to format.
@DefaultCountryCode optional varchar(10)
Formats all phone numbers as international phone numbers and adds this country code if a country code is not specified in the phone number. If not specified mumbers without a country code will be formatted as a local phone number.