SqlServer给表增加字段语法(转载)

添加字段语法

alter table table_name add column_name +字段类型+ 约束条件

给一个表增加多个字段:

use NatureData
go
alter table XunHu add ID int identity (1,1),
MaleCount varchar(50) null,
Area varchar(50) not null,
Phenology int null;
go

表中添加自增id
alter table lianxi add id int primary key IDENTITY(1,1) NOT NULL

posted @ 2022-02-24 13:42  乌卡拉卡  阅读(884)  评论(0)    收藏  举报