如题

解决方案 »

  1.   

    比如说 
    表如下
    id    name
    null  a
    null  b
    null  c
    现在使它成以下
    id    name
    1     a
    2     b
    3     c
      

  2.   

    新建一个ID列,将该列的标识属性设为"是",即IDENTITY(自动增量)属性,并将基数设为1即可,系统会自动为现有行填充ID的.
      

  3.   

    用自增类型的字段。。
    identity类型字段
      

  4.   


    select *,identity(int,1,1) tid
    into #temp
    FROM tableNameupdate A
    set id=B.tid
    from tableName A
    inner join #temp B
    on A.name=B.name
      

  5.   

    大哥,我表里有数据了,id现在全是null你怎么设置标识呀