CREATE TABLE lh_sql_user
(
[autoid] [bigint] IDENTITY(1,1) NOT NULL PRIMARY KEY , --系统id 自增加 +1 IDENTITY(1,1) 自增加 NOT NULL 不能为空 PRIMARY KEY 主键
[username] [varchar](100) NOT NULL DEFAULT ('无'), --用户姓名 NOT NULL 不能为空 DEFAULT ('无') 默认值空
[age] [int] NOT NULL DEFAULT (0), --年龄 NOT NULL 不能为空 DEFAULT (0) 默认值0
[wages] [dec] (18,2) NOT NULL DEFAULT (0),--工资 NOT NULL 不能为空 DEFAULT (0) 默认值0
[birthday] [date] NOT NULL DEFAULT ('1900-01-01'), --生日 NOT NULL 不能为空 DEFAULT ('1900-01-01') 默认值 '1900-01-01'
)
sqlserver 创建表语句
于 2024-03-17 14:07:48 首次发布
![](https://img-home.csdnimg.cn/images/20240611030827.png)