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 |
|
-fred-
Starting Member
5 Posts |
Posted - 2004-08-12 : 23:01:58
|
| sorry for my slightly stupid question..hehe i'm just a newbie using ms-sqlhow can i remove a certain character from the table?example:client_no-------------ALS186//E200ARA269//E205how can i update all those having 2 '/' in between..i just want to remove the 2nd '/' between those characters..hope you can help me..tnx in advance.. |
|
|
kselvia
Aged Yak Warrior
526 Posts |
Posted - 2004-08-12 : 23:56:56
|
| This should work:update mytable set client_no = replace(client_no,'//','/')--Ken"Knowledge is a process of piling up facts; wisdom lies in their simplification." |
 |
|
|
-fred-
Starting Member
5 Posts |
Posted - 2004-08-13 : 01:19:32
|
| oh ok.. hehe.. thank you so much.. |
 |
|
|
-fred-
Starting Member
5 Posts |
Posted - 2004-08-13 : 03:29:42
|
| another problem...hope anyone can help...the same as above but the problem is i can't seem to replace the word "transfer to" to "tct"exmaple:client_name-----------phil/transfer to afptransfer to japjap/transfer to japis used this code:update mytableset client_name = replace(client_no,'transfer to','tct')yes, it worked but...result:client_name-----------phil/transfer to afptct japjap/transfer to japquestion: i don't know why it couldn't change all those "transfer"thanks in advance... |
 |
|
|
kselvia
Aged Yak Warrior
526 Posts |
Posted - 2004-08-13 : 03:37:47
|
| I assume you actually used client_name instead of client_no in the replace function. Is it possible there are tabs or multiple spaces between some 'transfer' and 'to'?--Ken"Knowledge is a process of piling up facts; wisdom lies in their simplification." |
 |
|
|
-fred-
Starting Member
5 Posts |
Posted - 2004-08-13 : 04:01:02
|
| oh sorry, typo-error...my code was correct, i have just mis-typed when i post here..code is used:update mytableset client_name = replace(client_name,'transfer to','tct')is there any turn-around with regards to my problem... |
 |
|
|
mr_mist
Grunnio
1870 Posts |
Posted - 2004-08-13 : 04:15:07
|
| That code is fine, what version of SQL are you using? Is it service packed? Otherwise like Ken says it is probably not a space in between transfer and to.-------Moo. :) |
 |
|
|
|
|
|