Yeah, it's pretty simple. Maybe it'll help someone out.-- USAGE: fn_extract_chars(string_to_search, 'letters' -or- 'numbers')CREATE FUNCTION fn_extract_chars (@x varchar(128), @y char(7))RETURNS varchar(128)ASBEGIN DECLARE @chars varchar(128) DECLARE @pos int DECLARE @action varchar(32) SET @pos = 0 SET @chars = '' IF @y = 'numbers' SET @action = '[0-9]' ELSE IF @y = 'letters' SET @action = '[a-zA-Z]' WHILE @pos < (DATALENGTH(@x) + 1) BEGIN IF PATINDEX(@action,SUBSTRING(@x, @pos, 1)) > 0 BEGIN SET @chars = @chars + (SELECT SUBSTRING(@x, @pos, 1)) END SET @pos = @pos + 1 END RETURN(@chars)END