A wrinkle on this problem occurs when the text 'number' has a decimal point, at least in TSQL, that causes the solution above to not work.
Just posting in case it might help others. Drove me crazy for an hour.
A solution seems to be to first converting to float and then to bigint.
select cast(1234567891011.0 as varchar(50)) as numb1 into #t1;
select * from #t1;
select numb1
,cast(numb1 as bigint) as numb1x
from #t1; --Error converting data type varchar to bigint.
--Even though it is a number:
select numb1
,isnumeric(numb1) as isnumb
from #t1;
--proposed solution above fails:
select numb1,
CASE WHEN isnumeric(numb1)=1 then cast(numb1 as bigint)
ELSE 0
END as numb1x
from #t1;
--Error converting data type varchar to bigint.
--works:
select numb1
,cast(cast(numb1 as float) as bigint) as numb1x
from #t1;
where isnumeric(seconds) = 0