rt

解决方案 »

  1.   

    create table tb(id int identity(1,1))
      

  2.   

    create table tb
    (
      id int identity(1,1),
      col varchar(10)
    )
      

  3.   

    create table tb(id int identity(1,1),n varchar(10))insert into tb values('001')select * from tb
    /*id          n
    ----------- ----------
    1           001(1 行受影响)*/drop table tb
      

  4.   


    ALTER TABLE T
    ADD id int identity(1,1)
      

  5.   


    select tid=identity(int,1,1),* into # from tb
      

  6.   


    SELECT (SELECT count(1) FROM t WHERE id<=A.id)ID,*
    FROM t A