类似下面例子,判断不存在字段则增加IF NOT EXISTS (SELECT a.name FROM syscolumns a,sysobjects bWHERE a.id=b.idAND LTRIM(a.name)='col_name' AND LTRIM(b.name)='tablename')ALTER TABLE [tablename] ADD [col_name] char(3) NULLGO