create table #aa(id int identity (1,1) not null,field1 varchar(10))

解决方案 »

  1.   

    SQL SERVER企业管理器-->右键你的表-->设计表-->选中你要设置标识的字段(必须是int或其他数字类型)-->下面有个属性叫“标识”的,选“是”,你可以按你的要求改一下标识种子或标识递增量,然后保存该表的设计。
      

  2.   

    类型为:
    int identity(1,1)
      

  3.   

    自增列   类型为:int identity(1,1)  当然也可以是bigint,smallint 
       eg: create table tbName(id int identity(1,1),description varchar(20))
       或在用企业管理器设计表字段时,将字段设为int,将标识设为是,其它用默认即可