|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
REPLACE SUBSTRING BETWEEN TWO CHARACTERSHi.
I have to replace substrings which are between two characters. For example: I have to replace or remove all the characters that are between ' \': So, i have the string abcde\fgh\ikl and i want to get: abcdeikl. I use the following select statement: REPLACE(ColumnName, SUBSTRING([ColumnName, CHARINDEX('\', ColumnName), CHARINDEX('\', ColumnName, CHARINDEX('\', ColumnName) + 1) - CHARINDEX('\', ColumnName + 1), '') Is there any more efficient way? Thanks. |
|||||||||||||||||||||||