--错了。
patindex('%[^-^0-9]%',col)=0 :表示包含正数或者负数。或者0
即表示,数字的字段!

解决方案 »

  1.   

    --3楼错了吧!好象是包含数字的字段啊!
    --测试环境declare @t table (a varchar(10))
    insert into @t select '-0111'
    union all select 'A2222'
    union all select 'ABB'
    union all select 'ABBT'
    union all select '222'
    union all select '222T'
    union all select '222-T'
    union all select '0'
    --测试
    select * from @t where patindex('%[^-^0-9]%',a)=0
    --结果
    a          
    ---------- 
    -0111
    222
    0(所影响的行数为 3 行)
      

  2.   

    PATINDEX('%[^-^.^0-9]%',col+'a')
    '%[^-^.^0-9]% 中间有.没点怎么都能通过查询