通过SQL脚本增加现有数据库中的字段

方法一:语句:alter table a add fieldname int; 说明:a 表示要增加到哪个数据表中的那个数据表的名字;fieldname是要增加的字段 int 增加字段的数据类型. 已经测试成功! 方法二:要在AA数据表中增加 class int(类型) 0(默认值) 和 admin int 0 语法实现如下: if not exists (select 1 from syscolumns where id=object_id('AA') and name='class') alter table aa add class int default(0...