Reputation: 2723
As you know TSQL has the CHAR() that returns character. This is very useful when the character is a non-ASCII glyph such as
ie. SELECT CHAR(191)
gives ¿
Question: Is there a way to use this CHAR() function in a LIKE '%CHAR(191)%' query? The reason I ask this is not every symbol is visible and I want to search them up in order to replace them such as
ex: Replace "µ" with "micro"
REPLACE(Description,'µ','micro') WHERE Description like '%µ%'
but I wish to do it similar to this:
REPLACE(Description,CHAR(181),'micro') WHERE Description like '%CHAR(181)%'
Upvotes: 2
Views: 173
Reputation: 62861
You can, you just need to concatenate the string instead of leaving it all in quotes:
WHERE Description like '%' + char(181) + '%'
Upvotes: 2