select '00'+rtrim(字段名) from 表

解决方案 »

  1.   

    create table tb(id int)
    insert into tb select 1
    insert into tb select 2
    insert into tb select 3
    insert into tb select 4
    insert into tb select 5
    insert into tb select 6
    insert into tb select 7
    insert into tb select 8
    insert into tb select 9select '00'+ltrim(id) as id from tb 001
    002
    003
    004
    005
    006
    007
    008
    009
      

  2.   

    update tb set id = '00'+id
    --id的数据类型应该为varchar
      

  3.   

    先建立一个tid 字段 varchar类型
    然后用 
    update tb set tid ='00'+id看看tid 是否正确正确的话,删除id字段更改tid字段名为id