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 |
|
freephoneid
Yak Posting Veteran
52 Posts |
Posted - 2010-05-18 : 18:51:43
|
| Hi, I need to update all email address in the database to as shwon below:Lets say, I've email column with below data:abc@hotmail.comxyz@yahoo.comram@abccorp.comThen, I need to update the above data as shown below:abc@1hotmail.comxyz@1yahoo.comram@1abccorp.comBasically, I need to append 1 after @ sign. Is this possible using SQL query? If so, I'll really appreciate if some one can provide it.Thanks! |
|
|
singularity
Posting Yak Master
153 Posts |
Posted - 2010-05-18 : 19:26:26
|
| [code]select left(email, charindex('@', email)) + '1' + substring(email, charindex('@', email)+1, len(email))from yourtable[/code] |
 |
|
|
freephoneid
Yak Posting Veteran
52 Posts |
Posted - 2010-05-18 : 19:31:11
|
| Thanks a lot, singularity!!!!!! |
 |
|
|
|
|
|