--子增长的插入
/*创建表*/
create table teacher
(
id int identity(1,1) primary key not null,
name varchar(20)
)

select * from teacher

/*关闭自增长*/
SET IDENTITY_INSERT teacher on

insert into teacher(id,name) values(2000,'guo')

/*打开自增长*/
SET IDENTITY_INSERT teacher off

insert into teacher(name) values('guo')

05-11 02:46