zero98atm
SSC Enthusiast
Points: 115
More actions
February 12, 2003 at 9:43 am
#174904
How can I run a replace function on all records in a table? For instance, if I wanted to loop through a phone number field in a table and replace all of the "-"'s with "", what's the easiest way to do this?
Greg Larsen
SSC-Insane
Points: 20961
February 12, 2003 at 9:46 am
#448764
Have not tested this but try:
update <yourtable>
set phone = replace(phone,'-','')
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
Gregory A. Larsen, MVP
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply