IF not EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'PopularityCoupon' AND COLUMN_NAME = 'Mat_ID') begin alter table dbo.PopularityCoupon Add Mat_ID bigint references dbo.Matter(ID) not null default -1 end