如何给表添加新的字段

其实就这样一句代码,alter table [表名]  add [字段名]  字段的数据类型 举个例子:

create table UserInfo
(
     id uniqueidentity primary key ,
     name varchar(
50),
     sex bit
)

之后我创建了这张表,觉得少了一个字段,而表存储了好多的数据,不可以删掉表,重建。运行下面那段代码就是在已经建好的表当中添加一个新的字段那就是年龄Age

alter table UserInfo add Age 
int 

原文地址:https://www.cnblogs.com/axinno1/p/1652556.html