Declare @Id Int                               

Select @Id = Id From sysobjects Where Name = 'Headh'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Tot_Price_Cooperative')
  Alter Table Headh Add Tot_Price_Cooperative Money 


Select @Id = Id From sysobjects Where Name = 'Headh'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Kind_Cooperative')
  Alter Table Headh Add Kind_Cooperative Smallint


Select @Id = Id From sysobjects Where Name = 'TmpHeadh'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Kind_Cooperative')
  Alter Table TmpHeadh Add Kind_Cooperative Smallint


Select @Id = Id From sysobjects Where Name = 'TmpHeadh'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Tot_Price_Cooperative')
  Alter Table TmpHeadh Add Tot_Price_Cooperative Money 


Select @Id = Id From sysobjects Where Name = 'TmpHavaleh'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Cooperative_Flag')
  Alter Table TmpHavaleh Add Cooperative_Flag Char(1) Default(0)


Select @Id = Id From sysobjects Where Name = 'Havaleh'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Cooperative_Flag')
  Alter Table Havaleh Add Cooperative_Flag Char(1)


Select @Id = Id From sysobjects Where Name = 'TblGuy_Info'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Rent')
  Alter Table Tblguy_Info Add Rent Money Default(0)



Select @Id = Id From sysobjects Where Name = 'Sanad'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Nu_Cooperative')
  Alter Table Sanad Add Nu_Cooperative Bigint Default(0)