I see few questions related to this in forums on how to extract only numbers from an alphanumeric string.
Well there can be many methods to do this. One method is to use number table and extract them using a regular expression
Declare @s varchar(100),@result varchar(100) set @s='as4khd0939sdf78' set @result='' select @result=@result+case when number like '[0-9]' then number else '' end from ( select substring(@s,number,1) as number from ( select number from master..spt_values where type='p' and number between 1 and len(@s) ) as t ) as t select @result as only_numbers
The result is
only_numbers ------------------- 4093978