IDENTITYeg:
create table A
(
id int IDENTITY (1,1)NOT NULL,
phone int,
context varchar(10),
re varchar(100),
type int
)
insert A
select 123,'A1','',1 union
select 123,'A1','sfsdf',1 union
select 456,'A2','fsfsdf',1 union
select 789,'A1','',1 union
select 123,'A3','sdf',2
create table A
(
id int IDENTITY (1,1)NOT NULL,
phone int,
context varchar(10),
re varchar(100),
type int
)
insert A
select 123,'A1','',1 union
select 123,'A1','sfsdf',1 union
select 456,'A2','fsfsdf',1 union
select 789,'A1','',1 union
select 123,'A3','sdf',2
IDENTITY [ ( seed , increment ) ]参数
seed装载到表中的第一个行所使用的值。increment增量值,该值被添加到前一个已装载的行的标识值上。必须同时指定种子和增量,或者二者都不指定。如果二者都未指定,则取默认值 (1,1)。