Reputation: 481
I have a product name with „ “
characters. How can escape both ( „
and “
) characters in SQL Server.
I have tried the following.
SELECT REPLACE('ts. & dot. test testing. „G“ ', '\„\“', '');
Upvotes: 1
Views: 61
Reputation: 34774
You don't need to escape either, just need nested REPLACE()
statements:
SELECT REPLACE(REPLACE('ts. & dot. test testing. „G“ ', '„', ''),'“','');
Returns: ts. & dot. test testing. G
REPLACE()
is looking for a literal string to replace, in your example the literal string „“
never occurs, so nothing is replaced.
Upvotes: 2