sql server - Select records that fail casting varchar column to bigint -
is there easy way records casting varchar column bigint fail? causes conversion error:
select cast(imei bigint)from rma
use sql example:
if object_id('tempdb..#rma') not null drop table #rma create table #rma ( imei varchar(20) ) insert #rma(imei)values('352382021485772') insert #rma(imei)values('352022033456409') insert #rma(imei)values('bn332vwy653577440220') select * #rma select cast(imei bigint)from #rma drop table #rma
so, in example need record imei='bn332vwy653577440220'.
thank you.
try t-sql isnumeric
function:
select imei #rma isnumeric(imei) = 0 -- not numeric
Comments
Post a Comment