There is no built-in function for this, but not too difficult to build.-- prepare sample datadeclare @t table( a varchar(100))insert @t select '173hs' union all select '58d' union all select 'aa' union all select '863'-- actual queryselect left(a, patindex('%[^0-9]%', a)-1) as afrom @twhere patindex('%[^0-9]%', a) > 1union allselect afrom @twhere patindex('%[^0-9]%', a) = 0Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"