通过 IDENTITY 来设置 参数有2个,一个是“初始值” 一个是“增量”。
默认情况下 INSERT 语句中,不能对 IDENTITY 的字段进行赋值。
create table web_product_info (
pid int IDENTITY(1, 1) not null,
code_id char(9) not null,
product_name varchar(200) not null,
Info5 varchar(50) null,
constraint PK_WEB_PRODUCT_INFO primary key nonclustered (pid)
)
go