📌  相关文章
📜  t-sql 从字符串中删除所有非字母数字字符 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:55.802000             🧑  作者: Mango

代码示例1
Create Function [dbo].[RemoveNonAlphaCharacters](@Temp VarChar(1000))
Returns VarChar(1000)
AS
Begin

    Declare @KeepValues as varchar(50)
    Set @KeepValues = '%[^a-z]%'
    While PatIndex(@KeepValues, @Temp) > 0
        Set @Temp = Stuff(@Temp, PatIndex(@KeepValues, @Temp), 1, '')

    Return @Temp
End