--判断表中是否存在这个字段,不存在就新增
if not exists(select * from sys.columns where name='字段名称' and [object_id]=object_id(N'表名'))
begin
alter table 表名 add 字段名称 money;
end
GO
--判断表中是否存在这个字段,存在就删除
if exists(select * from sys.columns where name='字段名称' and [object_id]=object_id(N'表名'))
begin
ALTER TABLE 表名 DROP COLUMN 字段名称;
end
GO