Declare @Id Int                               
Select @Id = Id From sysobjects Where Name = 'Kalaid'
if not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Gid_Fk1')
  Alter Table dbo.Kalaid Add Gid_Fk1 Char(3) NULL


Select @Id = Id From sysobjects Where Name = 'Kalaid'
if not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'Gid_Fk2')
  Alter Table dbo.Kalaid Add Gid_Fk2 Char(3) NULL

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