CREATE FUNCTION [dbo].[ParseNumbers]
(
@string VARCHAR(50)
)
RETURNS VARCHAR(50)
AS
BEGIN
DECLARE @IncorrectCharLoc SMALLINT
SET @IncorrectCharLoc = PATINDEX('%[^0-9]%', @string)
WHILE @IncorrectCharLoc > 0
BEGIN
SET @string = STUFF(@string, @IncorrectCharLoc, 1, '')
SET @IncorrectCharLoc = PATINDEX('%[^0-9]%', @string)
END
SET @string = @string
RETURN @string
END
-
« SQL Server: Convert to Proper case function | Create row numbers based on the rows available in a table »
Parse Numbers from AlphaNumeric strings
@ 2009-03-27 – 14:04:55
0 Trackbacks to Parse Numbers from AlphaNumeric strings
Related posts
-
Using a SELECT statement with a searched CASE expression
on 2009-07-07 – 11:00:59 -
Reporting Services Tip
on 2009-03-27 – 14:36:16 -
Create row numbers based on the rows available in a table
on 2009-03-27 – 14:30:32 -
Parse Numbers from AlphaNumeric strings
on 2009-03-27 – 14:04:55 -
SQL Server: Convert to Proper case function
on 2009-02-17 – 17:08:44 -
RS2005: Convert to Proper Case
on 2009-02-13 – 20:14:02 -
DatePicker control for SQL RS2005 SP2
on 2008-07-30 – 16:34:14 -
Data migration in Oracle
on 2007-02-02 – 11:13:00 -
Identify and delete duplicate rows in a table
on 2007-02-02 – 10:59:07 -
Group total summary
on 2007-01-15 – 15:29:32
