1Create Function [dbo].[RemoveNonAlphaCharacters](@Temp VarChar(1000))
2Returns VarChar(1000)
3AS
4Begin
5
6 Declare @KeepValues as varchar(50)
7 Set @KeepValues = '%[^a-z]%'
8 While PatIndex(@KeepValues, @Temp) > 0
9 Set @Temp = Stuff(@Temp, PatIndex(@KeepValues, @Temp), 1, '')
10
11 Return @Temp
12End