create table struden(
ID int primary key not null,
name1 varchar(10) not null,
age int null
)
alter table struden
alter column name1 varchar(100);--更改字段类型长度 alter column 字段名 类型的长度
alter table strudend
alter column age float;--数据类型的修改
alter table struden
alter column age float not null;--添加not null
alter table struden
add constraint KID primary key (ID);--设置主键
alter table struden--更改字段名 exec sp_rename '表名.字段名','更改后的字段名',‘column’
exec sp_rename 'struden.age','userage','column';
alter table struden
add grade varchar(10) not null;
drop table struden;--删除数据表