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