create table   Xl_StorePictureCategory 

StorePictureCategoryId int identity(1,1)   //  identity(int,1,1)有什么区别么?
,[Name] nvarchar(25),PRIMARY KEY ( StorePictureCategoryId)
 
) 小f妹妹

解决方案 »

  1.   

    建表时必须是 int identity(1,1) 类似这样的 
    identity(int,1,1) 只能在  select ..into ..from.. 
      

  2.   

    創建表時候用
    create table tb(id int identity(1,1),name varchar(10))
    生成表時候用
    select ID=identity(int,1,1),* into newtable from tb
      

  3.   

    IDENTITY(函数)
    :identity(int,1,1)
    IDENTITY(属性)
    :identity(1,1)
      

  4.   

    建表时不能使用 identity(int,1,1),只能使用 int identity(1,1),
      

  5.   

    楼上的高手都写了 创建的时候用int identity(1,1)
    生成表的时候用identity(int,1,1)
      

  6.   

    create table  Xl_StorePictureCategory 

    StorePictureCategoryId int identity(1,1)  //  identity(int,1,1)有什么区别么? 
    ,[Name] nvarchar(25) ,PRIMARY KEY ( StorePictureCategoryId) ) 
    create table  Xl_StorePictureCategory 

    StorePictureCategoryId  identity(int,1,1)有什么区别么? 
    ,[Name] nvarchar(25) ,PRIMARY KEY ( StorePictureCategoryId) ) 这样运行会报错的..
    identity(int,1,1)---插入临时表时用.
      

  7.   

    select id=identity(int,1,1),* into #t from tb
    这个句子用于生成id自增的临时表#t