- 我的电脑系统:Windows 10 64位
- SQL Server 软件版本: SQL Server 2014 Express
本篇博客里面使用了
scott
库,如何你现在还没有添加这个库到你的服务器里面,请在查看本篇博客前,访问这篇博文来在你的服务器里面附加scott
库。
identity
的用法 — 如何设置主键自动增长(用户不需要为identity修饰的主键赋值)
create table student3
(
student_id int primary key identity (100, 5),
student_name nvarchar(200) not null
)
select * from student3
insert into student3 (student_name) values ('张三');
insert into student3 values ('李四'); -- ok
delete from student3 where