How to strip all non-alphabetic characters from string in SQL Server?

后端 未结 18 1710
情深已故
情深已故 2020-11-21 23:49

How could you remove all characters that are not alphabetic from a string?

What about non-alphanumeric?

Does this have to be a custom function or are there

18条回答
  •  我寻月下人不归
    2020-11-22 00:41

    I put this in both places where PatIndex is called.

    PatIndex('%[^A-Za-z0-9]%', @Temp)
    

    for the custom function above RemoveNonAlphaCharacters and renamed it RemoveNonAlphaNumericCharacters

提交回复
热议问题