Replace script to edit email addresses

I found in my SQL 2012 tables that many (hundreds) of members have .C0M in their email addresses instead of .COM.  I'd like to run a script to find them and replace the .C0M with .COM.  The email addresses reside in one table, but in two different columns

Any suggestions?  Can I use a replace statement with a wildcard *.C0M?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott PletcherSenior DBACommented:

UPDATE table_name
SET column1 = REPLACE(column1, '.C0M', '.COM'), column2 = REPLACE(column2, '.C0M', '.COM')
WHERE column1 LIKE '%.C0M%' OR column2 LIKE '%.C0M%' --just for efficiency, not technically required

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Brian CroweDatabase AdministratorCommented:
You should be able to use the REPLACE function as long as you can confirm that ".C0M" doesn't appear anywhere else besides the domain suffix.

UPDATE myTable
SET ColumnA = REPLACE(ColumnA, '.C0M', '.COM'),
        ColumnB = REPLACE(ColumnB, 'C0M', '.COM')
JCONNELLY626VP ITAuthor Commented:
Perfect on both.  Thank you, Thank you.  Updated 770 records between a bad C0M and and instead of
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.