Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Uniform Format for Phone Numbers in Table

$
0
0

I have a table (in SQL 2000) that has phone numbers entered like this:

(xxx) xxx-xxxx
xxx-xxx-xxxx
xxxxxxxxxx
xxx xxx xxxx

Obviously, there should be controls in the app to only accept them in a specific format or auto-format them when they are entered but this is not the case.  I was wondering if it would be possible to run some sort of script to auto-format all phone numbers so that they are stored in the table like this: (xxx) xxx-xxxx.  Since they are in a variety of formats, is there a simple way to do this?  I have tried a few things that I have found online (I'm testing them in a DB backup) but nothing has given me the results that I am after.

Thanks in advance.
-Chris


Viewing all articles
Browse latest Browse all 4871

Trending Articles