SQL自增长的数据插入
时间:2014-06-10 12:21:35
收藏:0
阅读:243
--子增长的插入
/*创建表*/
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‘)
评论(0)