IF not EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ContractHistory' AND COLUMN_NAME = 'CH_ID') begin alter table ContractHistory add CH_ID int references ContractHistory(ID) null end ; IF not EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'ContractHistory' AND COLUMN_NAME = 'CH_ID_Parent') begin alter table ContractHistory add CH_ID_Parent int references ContractHistory(ID) null end