IF not EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'VoucherRefrenceID' AND COLUMN_NAME = 'ProductDetail_ID') begin alter table VoucherRefrenceID add ProductDetail_ID int references ProductDetail(ID) null end ; IF not EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'VoucherRefrenceID' AND COLUMN_NAME = 'ConvertGood_ID') begin alter table VoucherRefrenceID add ConvertGood_ID int references ConvertGood(ID) null end ; IF not EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'VoucherRefrenceID' AND COLUMN_NAME = 'StoreDocumentAccount_ID') begin alter table VoucherRefrenceID add StoreDocumentAccount_ID int references StoreDocumentAccount(ID) null end ; IF not EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'VoucherRefrenceID' AND COLUMN_NAME = 'CommercialStore_ID') begin alter table VoucherRefrenceID add CommercialStore_ID int references CommercialStore(ID) null end