IF not EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'attachment' AND COLUMN_NAME = 'Dom_ID') begin alter table attachment add Dom_ID int references Domain(ID) null end