IF NOT EXISTS(select a.name FROM sys.all_columns s join sys.tables a on a.object_id = s.object_id where s.name = 'V006MedicalTerms' and a.name = 'T_MO_DATE_TYPE')
BEGIN

ALTER TABLE IES.T_MO_DATE_TYPE ADD V006MedicalTerms int null

ALTER TABLE [IES].[T_MO_DATE_TYPE] ADD CONSTRAINT [FK_T_V006_MEDICAL_TERMS_T_MO_DATE_TYPE_V006MedicalTerms]
FOREIGN KEY([V006MedicalTerms]) REFERENCES [IES].[T_V006_MEDICAL_TERMS] ([IDUMP])

END