給表新增 欄位 並給預設值
判斷是為了不重複新增
if (select count(*) from sysobjects a,syscolumns b where a.id=b.id and b.name='你要加的欄位' and a.type='u' and a.name='你要新增欄位的表' ) < 1
BEGIN
alter table 你要新增欄位的表 add 你要加的欄位char(1) default 預設值 not null ;
end
刪除的話
alter table 表名 drop column 欄位名