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
 General SQL Server Forums
 New to SQL Server Programming
 replace function

Author  Topic 

aakcse
Aged Yak Warrior

570 Posts

Posted - 2012-07-17 : 06:45:34
In a column I want to replace the second occurance of single char '/' with char(32) I,e. space.

How can I do so?

I am able to locate that value but not able to replace I have a function "count_char" to find the number of rec which has '/' more than once

update #table1 set col1= Replace...
where CountChar(lump,'/')>1

I am able to locate that char by using below string fun

SUBSTRING(col1,charindex('/',col1, CHARINDEX('/',col1,1)+1),1)


-Neil

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-07-17 : 06:47:16
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=176853


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

aakcse
Aged Yak Warrior

570 Posts

Posted - 2012-07-17 : 06:59:08
This works perfectly great thanks

-Neil
Go to Top of Page
   

- Advertisement -