create database test
go
use test
go
create table test
(
ID int,
Name nvarchar(50)
)
go
1 表字段增加
alter table test add Name2 nvarchar(150)
go
2 删除表字段
alter table test drop column Name2
go
3 修改表字段数据类型
alter table test alter column Name nvarchar(150)
go
4 修改表字段名称
exec sp_rename 'test.[id]','product_id','column'
go