Created
January 2, 2018 17:13
-
-
Save codenamejason/34465b4920c08aca2c70426c17cec67b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create Function [dbo].[RemoveNonNumericCharacters](@Temp VarChar(1000)) | |
Returns BigInt | |
AS | |
Begin | |
Declare @Return BigInt | |
Declare @KeepValues as varchar(50) | |
Set @KeepValues = '%[^0-9]%' | |
While PatIndex(@KeepValues, @Temp) > 0 | |
Set @Temp = Stuff(@Temp, PatIndex(@KeepValues, @Temp), 1, '') | |
Set @Return = cast(ISNULL(@Temp,'0') as BigInt) | |
Return @Return | |
End |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment