추출 (1) 썸네일형 리스트형 [function] 문자열에서 숫자만 뽑아내기 CREATE FUNCTION fn_GetNumeric (@strAlphaNumeric VARCHAR(256)) returns VARCHAR(256) AS BEGIN DECLARE @intAlpha INT SET @intAlpha = Patindex('%[^0-9]%', @strAlphaNumeric) BEGIN WHILE @intAlpha > 0 BEGIN SET @strAlphaNumeric = Stuff(@strAlphaNumeric, @intAlpha, 1, '') SET @intAlpha = Patindex('%[^0-9]%', @strAlphaNumeric) END END RETURN Isnull(@strAlphaNumeric, 0) END 예) SELECT dbo.fn_GetNumeric('1.. 이전 1 다음