Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Splitting Phone Numbers

Author  Topic 

a.rameshk
Starting Member

19 Posts

Posted - 2007-08-14 : 05:28:27
PhoneNumber column is there in the Study table.And the Data wich is in PhoneNumber column is like this.DataType NVARCHAR

+1 864 233-8557
57-1- 5922994/5922999
NULL
NULL
+1 925 647-2828
+1 615 329-0197
+52-44-47-14-55-59
+55-11-5575-0052
+54-35-1425-7421
+1 713 590-8379
+1 972 492-8700
+1 267 503-0130
267-503-0130
+1 602 264-9806
713-779-3484
+1 251 928-8804
+1 415 751-6814
253-756-2182
+86-10-68314466 ext. 8395

Split this Data and put it into the Different Columns like CountryCode,AreaCode,Number,Extention.

What is the process to split the phone number. Please Helpme.

ashley.sql
Constraint Violating Yak Guru

299 Posts

Posted - 2007-08-14 : 08:24:35
search for SUBSTRING, LEN and CHARINDEX and you might be able to do it yourself.

Ashley Rhodes
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2007-08-14 : 11:15:54
http://sqlteam.com/forums/topic.asp?TOPIC_ID=50648
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2007-08-14 : 11:20:36
We also deal with a lot of numbers, but before storing them in our database (varchar) datatype, we format them in the front end removing the + or - signs and spaces. So it easier to manipulate.
Go to Top of Page
   

- Advertisement -