Declare @Id Int                               

Select @Id = Id From sysobjects Where Name = 'TmpHavaleh'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'VisitorCode')
  Alter Table TmpHavaleh Add VisitorCode VARCHAR(5) 

SELECT @Id = Id From sysobjects Where Name = 'Havaleh'
IF not Exists(SELECT * FROM syscolumns WHERE id = @Id and Name = 'VisitorCode')
  Alter Table Havaleh Add VisitorCode VARCHAR(5) 