create table test ( id int identity(1,1) not null primary key,....)

解决方案 »

  1.   

    create table test ( id int identity(1,1) not null primary key,....)
      

  2.   

    将主键(int)的属性设为标识列即可
      

  3.   

    CREATE TABLE YOUTABLENAME(
    ID INT IDENTITY(1,1) PRIMARY KEY,--主键
    NAME CHAR(9),
    .
    ..
    )
      

  4.   

    哦,那么sql语句怎么写?
    insert into test(id,....) values(?) 
      

  5.   

    insert into test(字段名2,字段名3.....) values(字段值2,字段值3,....),不用把主键包括就行了
      

  6.   

    thank  all of you !