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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 BASIC - email change from _ to ,

Author  Topic 

stingfish
Starting Member

2 Posts

Posted - 2013-10-21 : 15:23:09
all, this is a very basic update i need to do. it's been forever since i've messed w/sql so i wanted to check here.

Goal. Change the email local part from _ to .

Example - i have a users table. The email column contains users with email like this. mike_smith@bananas.com. I need to change all users to mike.smith@bananas.com.

Would this work:
update mytable
set email = replace(email, '_', '.')

If you have better way of doing this, will you please share with me?

thanks

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-10-21 : 15:36:39
That would work. It will change every instance of underscore to a period. If that is what you want, then what you have is good to go.
Go to Top of Page

stingfish
Starting Member

2 Posts

Posted - 2013-10-22 : 08:33:28
Many thanks James - I just tested this in my staging db and it worked.

Go to Top of Page
   

- Advertisement -