I have never done a mass update to replace records (newbie) in a table so I am looking for some help with the syntax which I'm sure is easy.
I have a table called Parts. In that table there I have a field name called femail. I have records in that field name for email addresses. So records do not require an email address so they are null values.
For the records they contain multiple email addresses in that field which are all the same. So for example:
Femail
test1@test.com; test2@test.com
So my question is I want to do a mass replacment for the test1@test.com email and replace all of those records with JohnDoe@test.com
So the end result would be where test1@test.com was it should now show:
JohnDoe@test.com; test2@test.com
How would I accomplish this?
Microsoft SQL ServerMicrosoft SQL Server 2005Microsoft SQL Server 2008
Last Comment
EugeneZ
8/22/2022 - Mon
Vitor Montalvão
UPDATE PartsSET femail = REPLACE(femail,'test1@test.com','JohnDoe@test.com')WHERE femail LIKE 'test1@test.com'
Open in new window
Test this command in a development database before running it in Production environment.