SQL Server添加/删除/修改列示例

表结构:
create table UserTB
(
    Id int identity primary key,
    Name nvarchar(50) not null
)

1).添加列
alter table UserTB add Age int

2).删除列
alter table UserTB drop column Age

3).修改列
alter table UserTB alter column Name nvarchar(20) not null


评论: 0 | 引用: 0 | 查看次数: 2797
发表评论
登录后再发表评论!