Declare @Id Int                               
Select @Id = Id From sysobjects Where Name = 'AnbarId'
if not Exists(SELECT id FROM syscolumns WHERE id = @Id  and Name = 'Store_Code')
ALTER TABLE AnbarId ADD  Store_Code varchar(3) 


Select @Id = Id From sysobjects Where Name = 'TmpHeadH'
if not Exists(SELECT id FROM syscolumns WHERE id = @Id  and Name = 'Store_Code')
ALTER TABLE TmpHeadH ADD  Store_Code varchar(3) 



Select @Id = Id From sysobjects Where Name = 'TmpHeadC'
if not Exists(SELECT id FROM syscolumns WHERE id = @Id  and Name = 'Store_Code')
ALTER TABLE TmpHeadC ADD  Store_Code varchar(3) 



Select @Id = Id From sysobjects Where Name = 'TmpHeadS'
if not Exists(SELECT id FROM syscolumns WHERE id = @Id  and Name = 'Store_Code')
ALTER TABLE TmpHeadS ADD  Store_Code varchar(3) 


Select @Id = Id From sysobjects Where Name = 'HeadC'
if not Exists(SELECT id FROM syscolumns WHERE id = @Id  and Name = 'Store_Code')
ALTER TABLE HeadC ADD  Store_Code varchar(3) 



Select @Id = Id From sysobjects Where Name = 'HeadH'
if not Exists(SELECT id FROM syscolumns WHERE id = @Id  and Name = 'Store_Code')
ALTER TABLE HeadH ADD  Store_Code varchar(3) 


Select @Id = Id From sysobjects Where Name = 'HeadS'
if not Exists(SELECT id FROM syscolumns WHERE id = @Id  and Name = 'Store_Code')
ALTER TABLE HeadS ADD  Store_Code varchar(3) 

Select @Id = Id From sysobjects Where Name = 'Guy'
if not Exists(SELECT id FROM syscolumns WHERE id = @Id  and Name = 'Store_Code')
ALTER TABLE Guy ADD  Store_Code varchar(3) 


Select @Id = Id From sysobjects Where Name = 'Bank'
if not Exists(SELECT id FROM syscolumns WHERE id = @Id  and Name = 'Store_Code')
ALTER TABLE Bank ADD  Store_Code varchar(3) 


Select @Id = Id From sysobjects Where Name = 'Over_Under'
if not Exists(SELECT id FROM syscolumns WHERE id = @Id  and Name = 'StoreCode')
ALTER TABLE Over_Under ADD  StoreCode varchar(3) 


Select @Id = Id From sysobjects Where Name = 'TblshopSettings'
if not Exists(SELECT id FROM syscolumns WHERE id = @Id  and Name = 'Factor_Sanad')
ALTER TABLE TblshopSettings ADD  Factor_Sanad Char(1) Default(0) Null


Select @Id = Id From sysobjects Where Name = 'Account'
if not Exists(SELECT id FROM syscolumns WHERE id = @Id  and Name = 'Store_Code')
ALTER TABLE Account ADD  Store_Code varchar(3) 

