在access中如何用sql语句修改表?

来源:百度知道 编辑:UC知道 时间:2024/06/14 10:20:33
现在遇到一个问题,
要用sql语句在asp中之行修改表结构,
搜来搜去,
还是不太明白
其中一篇是这个:
http://www.oncecode.com/Html/Articles/429.htm
哪位大侠详细讲解一下咯?

已经写得很清楚了。
alter table test

alter column str text(30) not null

test为要修改的表
str为要修改的列名
text(30)为列的字段类型
至于not null则为此字段为必填项

//删除主键关系
alter table table2 drop constraint pk_1

/添加主键关系
alter table table2 add constraint pk_1 primary key (colname)

//添加新列
alter table table add column colname int not null
//要把新列设为主键 该列菲空
alter table 表名 add constraint colname primary key