SDU Tools are free tools and provide example T-SQL code for SQL Server developers and DBAs. There is often a requirement to consistently format phone numbers. The FormatAustralianPhoneNumber function takes a string that contains digits, extracts the digits, and formats the remaining number according to Australian phone number standards. Note: if the phone number starts with an international prefix + then the phone number is returned unchanged. The function could easily be adapted for other phone number formatting requiremments.
To join SDU Insiders and get all our free resources, including SDU Tools, see the details at http://sdutools.sqldownunder.com