how to substitute strange character in MS SQL server
Solution 1:
_
and %
have no significance in REPLACE
. These are only used by LIKE
and PATINDEX
.
Use an accent insensitive COLLATE
clause (AI
) to have o
and ó
treated interchangeably
SELECT
REPLACE (REPLACE ( Dcpt.[desc] COLLATE Latin1_General_100_CS_AI, N'Compañía', N'Compañía /'), N'Producción', N' Producción /' )
FROM Dcpt
Change CS
to CI
if you also want case insensitivity.