title: How to remove accents and all chars <> a..z in sql-server?
body: <p>I need to do the following modifications to a varchar(20) field:</p>
  
  <ol>
  <li>substitute accents with normal letters (like è to e)</li>
  <li>after (1) remove all the chars not in a..z</li>
  </ol>
  
  <p>for example</p>
  
  <pre><code>'aèàç=.32s df' 
  </code></pre>
  
  <p>must become </p>
  
  <pre><code>'aeacsdf'
  </code></pre>
  
  <p>are there special stored functions to achieve this easily?</p>
  
  <p><strong>UPDATE</strong>: please provide a T-SQL not CLR solution. This is the workaround I temporarly did because it temporarly suits my needs, anyway using a more elegant approach would be better.</p>
  
  <pre><code>CREATE FUNCTION sf_RemoveExtraChars (@NAME nvarchar(50))
  RETURNS nvarchar(50)
  AS
  BEGIN
    declare @TempString nvarchar(100)
    set @TempString = @NAME 
    set @TempString = LOWER(@TempString)
    set @TempString =  replace(@TempString,' ', '')
    set @TempString =  replace(@TempString,'à', 'a')
    set @TempString =  replace(@TempString,'è', 'e')
    set @TempString =  replace(@TempString,'é', 'e')
    set @TempString =  replace(@TempString,'ì', 'i')
    set @TempString =  replace(@TempString,'ò', 'o')
    set @TempString =  replace(@TempString,'ù', 'u')
    set @TempString =  replace(@TempString,'ç', 'c')
    set @TempString =  replace(@TempString,'''', '')
    set @TempString =  replace(@TempString,'`', '')
    set @TempString =  replace(@TempString,'-', '')
    return @TempString
  END
  GO
  </code></pre>