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 2005 Forums
 Transact-SQL (2005)
 using update query with like function

Author  Topic 

vimalg2006
Starting Member

4 Posts

Posted - 2008-09-30 : 07:26:39
Hi

I got a table with names and email address and basically i want to change the email addresses - for example vimalg2006@yahoo.co.uk to vimalg2006@wackyplay.com .....changing the part after the '@' sign??

How do i do this on sql server 2005??? please help

Vimal Gohil
Vimalg2006@yahoo.co.uk

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-30 : 07:29:01
use REPLACE
UPDATE YourTable
SET emailaddress=REPLACE(emailaddress,'@yahoo.co.uk','@wackplay.com')
Go to Top of Page

vimalg2006
Starting Member

4 Posts

Posted - 2008-09-30 : 07:43:04
Many thanks

Vimal Gohil
Vimalg2006@yahoo.co.uk
Go to Top of Page

CVDpr
Starting Member

41 Posts

Posted - 2008-09-30 : 16:55:28
quote:
Originally posted by visakh16

use REPLACE
UPDATE YourTable
SET emailaddress=REPLACE(emailaddress,'@yahoo.co.uk','@wackplay.com')




Yes, but what if has diffrent ones?: @gmail, @hotmail etc...?
so delete all after @ and add whatever.com.
Go to Top of Page
   

- Advertisement -