IF not EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Bargeh' AND COLUMN_NAME = 'Rep_ID') begin alter table dbo.Bargeh add Rep_ID int references dbo.Repair (ID) null end