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 2000 Forums
 SQL Server Development (2000)
 99 at the beginning of a phone number (DELETE a 9)

Author  Topic 

nicky
Starting Member

4 Posts

Posted - 2004-03-31 : 09:53:54
I would like to run an update query where for every record in a table of 20,000 records, that has 99 at the beginning of the phone number, can delete the first 9.

Any ideas??? I believe there are 10,000 phone numbers that are prefixed with 99 in total.

Table = Customers
phone_number, Varchar, 50


Nicky

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-03-31 : 10:04:00
This Should do it

update customers
set phone_number = right(phone_number, LEN(phone_number) - 1)
where phone_number like '99%'


Duane.
Go to Top of Page

nicky
Starting Member

4 Posts

Posted - 2004-03-31 : 10:37:09
Thank you so much for this query and your quick response!!

Nicky
Go to Top of Page
   

- Advertisement -