1.查询某列是否存在某表里,不存在则添加此列
if not exists(select 1 from dbo.syscolumns where name='列名' and ID=object_id('表名')) begin alter table 表名 add 列名 列类型 end