How can I remove accents on a string?

前端 未结 5 1915
悲&欢浪女
悲&欢浪女 2020-12-08 00:10

I have the following string

áéíóú

which I need to convert it to

aeiou

How can I achieve it? (I don\'t nee

5条回答
  •  旧巷少年郎
    2020-12-08 00:58

    Use this function:

    CREATE FUNCTION [dbo].[F_RemoveDiacritics] (
     @String varchar(max)
    )   RETURNS varchar(max)
    
    AS BEGIN
    DECLARE @StringResult VARCHAR(max);
    
    select @StringResult= @String collate SQL_Latin1_General_Cp1251_CS_AS
    
    return @StringResult
    
    
    END
    

提交回复
热议问题