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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Using Replace Function

Author  Topic 

sg2255551
Constraint Violating Yak Guru

274 Posts

Posted - 2011-01-17 : 00:09:09
hi

How do i replace many words in a string?

for example. "I m going to c u soon" and replace it to " I am going to see you soon?

Thanks

Sachin.Nand

2937 Posts

Posted - 2011-01-17 : 02:35:01
How do you decide that "c" needs to replaced by "see" and "u" with "you" and so on...?

PBUH

Go to Top of Page

sg2255551
Constraint Violating Yak Guru

274 Posts

Posted - 2011-01-17 : 06:03:24
hi

I should have given a proper example. propably like "Quicke browne foxes jump over a lazi dog" to "Quick brown fox jump over a lazy dog"

I just wanted to know how i can replace many words given any varchar length. Thanks
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-01-17 : 06:10:59
You can use the REPLACE function, but you need to have defined somewhere what words to replace with what words. That's what Sachin Nand was asking for.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -