CREATE FUNCTION [dbo].[fn_GetFloatFromText] (@name VARCHAR(max))
RETURNS NVARCHAR(max)
AS
BEGIN
DECLARE @str VARCHAR(MAx)
SET @str
= @name
WHILE PATINDEX('%[^0-9.]%', @str) > 0
SET @str = REPLACE(@str, SUBSTRING(@str, PATINDEX('%[^0-9.]%', @str), 1), '')
RETURN replace(@str, '-', '')
END
No comments:
Post a Comment