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
 Transact-SQL (2000)
 Updating the first 3 positions in a field

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-09-23 : 09:26:17
scott writes "I need to update the area code in a phone field. What is the syntax to do a replace on the first 3 positions in a field.

Thanks"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-09-23 : 09:35:36

update sometable
set phone = @new_area_code + right(phone,len(phone)-3)
where somecondition is true

 


Jay White
{0}
Go to Top of Page
   

- Advertisement -