SQL Help

Associate
Joined
3 Feb 2003
Posts
1,771
Location
Sydney, Australia
Hi Guys,

I'm sure this is the most basic of basic scripts imaginable so I'm hoping someone can help.

I have a table in SQL2000 which contains e-mail addresses (about 2000 of them).

[email protected]
[email protected]
[email protected]

I need to change all of these addresses to point to a different domain but retain the front portion.

[email protected]
[email protected]
[email protected]

Is there a simple way of doing this? It's going to be a complete ball ache if I have to do them individually through the ui.

Thanks
 
Yup, check out the REPLACE function (MSDN)

Code:
update YourTable
set yourField = replace(yourField, 'domain1', 'domain2')

That should do the trick - I believe SQL2000 supports it
 
Last edited:
Back
Top Bottom