Declare @Id Int                               
Select @Id = Id From sysobjects Where Name = 'Tmp_Over_Under_Factor_Drug'
if not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'IsDuty')
  Alter Table dbo.Tmp_Over_Under_Factor_Drug Add IsDuty BIT DEFAULT(0)


Select @Id = Id From sysobjects Where Name = 'Tmp_Over_Under_Factor_Cash'
if not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'IsDuty')
  Alter Table dbo.Tmp_Over_Under_Factor_Cash Add IsDuty BIT DEFAULT(0)


                        
Select @Id = Id From sysobjects Where Name = 'Tmp_Over_Under_Factor_Cash'
if not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Guy_Code')
  Alter Table dbo.Tmp_Over_Under_Factor_Cash Add Guy_Code VARCHAR(5)
