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