CREATE FUNCTION dbo.IsReallyNumeric(@AStr VARCHAR(64)) RETURNS BIT AS  
BEGIN  
  IF LEFT(@AStr, 1) = '-'  
    SET @AStr = SUBSTRING(@AStr, 2, LEN(@AStr))  
 
  DECLARE @pos TINYINT  
 
  SET @pos = 1 + LEN(@AStr) - CHARINDEX('.', REVERSE(@AStr))  
 
  RETURN CASE WHEN PATINDEX('%[^0-9.-]%', @AStr) = 0 
    AND CHARINDEX('.', @AStr) = 0
    AND CHARINDEX('-', @AStr) = 0
    AND CHARINDEX('+', @AStr) = 0
    AND CHARINDEX('^', @AStr) = 0
    AND LEN(@AStr)>0  
    AND @AStr NOT LIKE '%-%' 
    AND (((@pos = LEN(@AStr)+1) OR @pos = CHARINDEX('.', @AStr))) THEN  
    1  
  ELSE  
    0  
  END  
END