dbo.fnRemoveNonNumericCharacters

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Null on Null Input

False

Schema Bound

False

Assembly

Parameters

Name Data Type Length Description
(Result) varchar 1000
@strText varchar 1000

SQL Script

SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
create Function dbo.fnRemoveNonNumericCharacters(@strText VARCHAR(1000))
RETURNS VARCHAR(1000)
AS
BEGIN
    WHILE PATINDEX('%[^0-9]%', @strText) > 0
    BEGIN
        SET @strText = STUFF(@strText, PATINDEX('%[^0-9]%', @strText), 1, '')
    END
    RETURN @strText
END
GO

Depends On

No items found

Used By

No items found