1、代码添加一列
- alter table products
- add colume_test varchar(20) NULL
- --这里colume_test的类型是varchar,允许为空
- GO
2、代码修改列的数据类型
- alter table products
- alter column colume_test int NULL
- go
上图可以看出,colume_test的数据类型已经修改!
3、向数据表里面删除一列
- use mysamble
- alter table products
- drop column colume_test
- go
![image image](http://blog.chinaunix.net/attachment/201105/5/25498312_1304572128uVDJ.png)
4、菜单法添加表的列与删除列
![](http://blog.chinaunix.net/attachment/201105/6/25498312_1304681301vTcH.jpg)
![](http://blog.chinaunix.net/attachment/201105/6/25498312_1304681301aDIG.jpg)
阅读(2215) | 评论(0) | 转发(0) |