Declare @Id Int                               
Select @Id = Id From sysobjects Where Name = 'Over_Under'
if not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'GatePos')
  Alter Table Over_Under Add GatePos VARCHAR(15) 
  
  
Select @Id = Id From sysobjects Where Name = 'Over_Under'
if not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'PosBank')
  Alter Table Over_Under Add PosBank TINYINT

    
Select @Id = Id From sysobjects Where Name = 'Tmp_Over_Under_Factor_Cash'
if not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Note')
  Alter Table Tmp_Over_Under_Factor_Cash Add Note nvarchar(50) NULL
  
