In this case you can simply right a SQL Function to filter the text.
1 2 3 4 5 6 7 8 9 10 11 12 | CREATE Function [dbo].[GetAlphanumericTextOnly](@Temp VarChar(1000)) Returns VarChar(1000) AS Begin Declare @KeepValues as varchar(50) Set @KeepValues = '%[^a-z0-9]%' While PatIndex(@KeepValues, @Temp) > 0 Set @Temp = Stuff(@Temp, PatIndex(@KeepValues, @Temp), 1, '') Return @Temp End |
Then call the function
1 | SELECT [dbo].[GetAlphanumericTextOnly]('Nifal.Nizar1990@Hotmail.com') |
You will get the result as NifalNizar1990Hotmailcom