您的位置:首页 > 博客中心 > 数据库 >

SQL自增长的数据插入

时间:2022-03-10 17:33

--子增长的插入
/*创建表*/
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‘)

SQL自增长的数据插入,布布扣,bubuko.com

热门排行

今日推荐

热门手游