Skip to content

Instantly share code, notes, and snippets.

@grishin
Created January 30, 2014 11:50
Show Gist options
  • Select an option

  • Save grishin/8706957 to your computer and use it in GitHub Desktop.

Select an option

Save grishin/8706957 to your computer and use it in GitHub Desktop.
How to clean SQL string
CREATE Function [dbo].[fn_cc2RemoveNonAlphaCharacters](@Temp VarChar(1000))
Returns VarChar(1000)
AS
Begin
While PatIndex('%[^a-z]%', @Temp) > 0
Set @Temp = Stuff(@Temp, PatIndex('%[^a-z]%', @Temp), 1, '')
Return @TEmp
End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment