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 |
|
faisalpar
Starting Member
2 Posts |
Posted - 2009-06-08 : 07:51:07
|
| hello friends,i am new to SQL.i have a doubt regarding sql string manipulationi have a string 'jayaram palakkad jayaraman'i need to add XXX to word jayarambut when i replace i am getting output like 'jayaramXXX palakkad jayaramXXXan'but i need to add XXX only after jayaramhw can i do that??regardsfAiSaLsP |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-08 : 07:55:41
|
REPLACE(Col1 + ' ', 'jayaram', 'jayaramXXX' E 12°55'05.63"N 56°04'39.26" |
 |
|
|
faisalpar
Starting Member
2 Posts |
Posted - 2009-06-08 : 07:58:40
|
| can u explain it??fAiSaLsP |
 |
|
|
danasegarane76
Posting Yak Master
242 Posts |
Posted - 2009-06-08 : 08:13:26
|
| As you can see the Replace Command takes three arguments1.String to source string where the second string to be found2.String to found2.String to be replaced..The above will replace all values in the COL1 which has the word jayaram to jayaramXXX |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-06-08 : 08:19:55
|
quote: Originally posted by Peso REPLACE(Col1 + ' ', 'jayaram', 'jayaramXXX' E 12°55'05.63"N 56°04'39.26"
Shouldn't it beREPLACE(Col1 + ' ', 'jayaram ', 'jayaramXXX ' ? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-08 : 08:22:02
|
Yes. My bad. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
|
|
|