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.
| Author |
Topic |
|
dzabor
Posting Yak Master
138 Posts |
Posted - 2008-07-29 : 10:34:55
|
| I have a request to update all email addresses in a database to use our company domain. For example:Update mickeymouse@yahoo.com to mickeymouse@CompanyName.comThis is for testing purposes on a development db. Is there a way to accomplish this?Thanks,dz |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-29 : 10:57:33
|
| UPDATE yourtableSET emailfield= LEFT(emailfield,CHARINDEX ('@',emailfield)-1)+'YourCompanyName.com' |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-30 : 02:57:17
|
| orUPDATE yourtableSET emailfield= replace(emailfield,'yahoo.com','YourCompanyName.com')MadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-30 : 03:17:38
|
quote: Originally posted by madhivanan orUPDATE yourtableSET emailfield= replace(emailfield,'yahoo.com','YourCompanyName.com')MadhivananFailing to plan is Planning to fail
Not sure if email address will always have yahoo.com |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-30 : 04:07:21
|
quote: Originally posted by visakh16
quote: Originally posted by madhivanan orUPDATE yourtableSET emailfield= replace(emailfield,'yahoo.com','YourCompanyName.com')MadhivananFailing to plan is Planning to fail
Not sure if email address will always have yahoo.com 
Good point. Omit my previous reply MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|