[size=medium]//修改字段的类型
alter table fdi_news alter column c_author nvarchar(50)
//重命名字段的名称
EXEC sp_rename 'FDI_PROJECT.[c_foreignCountryPer]','c_foreignCompanyPer','COLUMN';
//增加字段
alter table fdi_news add c_author nvarchar(50)
//删除字段
alter table fdi_news drop c_author nvarchar(50)[/size]
alter table fdi_news alter column c_author nvarchar(50)
//重命名字段的名称
EXEC sp_rename 'FDI_PROJECT.[c_foreignCountryPer]','c_foreignCompanyPer','COLUMN';
//增加字段
alter table fdi_news add c_author nvarchar(50)
//删除字段
alter table fdi_news drop c_author nvarchar(50)[/size]
本文介绍了如何使用SQL语句来修改数据库表中的字段属性,包括字段类型的变更、字段名称的重命名、新增字段及删除字段等常见操作。
1067

被折叠的 条评论
为什么被折叠?



