Solved

MySQL query to change domain of all email addresses in a field

Posted on 2008-10-26
1
460 Views
Last Modified: 2008-10-26
I have a `users` table with a field called emailaddress with about 1500 records... each of them has the same domain associated with it..

user1@dallasray.com
user2@dallasray.com
user3@dallasray.com

We are switching to a new domain so how can I write a query that was find all instances of @dallasray.com and replace them with @southtexastech.com  ?

user1@southtexastech.com
user2@southtexastech.com
user3@southtexastech.com

etc.

thank you!
0
Comment
Question by:smetterd
1 Comment
 
LVL 27

Accepted Solution

by:
yodercm earned 500 total points
ID: 22808057
UPDATE users SET emailaddress=REPLACE(emailaddress,'@dallasray.com','@southtexastech.com')
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MS SQL 2008 Divide by zero error encountered. Error 3 35
SQL Server syntax question 13 30
Restore of mysql database from .SQL file - using Coldfusion 5 36
mysql date time 14 30
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Creating and Managing Databases with phpMyAdmin in cPanel.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question