在数据库表中插入字段,插入之前会判断该字段是否存在
declare @tableId intset @tableId = object_id('Atmonthd') if not exists ( select * from syscolumns where id = @tableId and name = 'OTShift_Hours')begin alter table Atmonthd add OTShift_Hours floatend

浙公网安备 33010602011771号