Hi syed,
Following is the sql code to get what you want:
"But donot forget to mark my answer as accepted if it helped you." :)
DECLARE @position int, @string nvarchar(max),@AsciiValue INT
SET @position = 1
SET @AsciiValue=0
SET @string = '100.00 kl'
DECLARE @TString nvarchar(max)
SET @TString = ''
WHILE @position <= DATALENGTH(@string)
BEGIN
SELECT @AsciiValue=ASCII(SUBSTRING(@string, @position, 1))
if ((@AsciiValue >= 48 AND @AsciiValue <=57) OR (@AsciiValue = 46))
begin
SET @TString =@TString + SUBSTRING(@string, @position, 1)
end
SET @position = @position + 1
END
PRINT 'Input String:' + @string
PRINT 'Output String:' + @TString
Output:
Input String:100.00 kl
Output String:100.00