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 |
|
tmccar
Starting Member
27 Posts |
Posted - 2012-07-06 : 07:48:09
|
| I want to change the email addresse domain of a group of users, which are in a table called "users", in the "email" column. I want to exclude some email addressesThis is the command I am using:update usersSet email = replace(email, 'cae.org', 'cae.com');except where email = (person1@cae.org, person2.cae.org, person3@cae.org);Does this look ok? I think the first part is ok, but I'm not sure about the "except" part. |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-07-06 : 07:52:57
|
update usersSet email = replace(email, 'cae.org', 'cae.com')where email like '%cae.org'and email not in('person1@cae.org', 'person2.cae.org', 'person3@cae.org') No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
tmccar
Starting Member
27 Posts |
Posted - 2012-07-06 : 09:21:25
|
| Many thanks, that works great. |
 |
|
|
|
|
|