--子增长的插入
/*创建表*/
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‘)
时间: 2024-11-09 13:15:51