t sql return on letters only

Solutions on MaxInterview for t sql return on letters only by the best coders in the world

showing results for - "t sql return on letters only"
Cyrielle
16 Nov 2019
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
13