IF NOT EXISTS (
  SELECT * 
  FROM   sys.columns 
  WHERE  object_id = OBJECT_ID(N'[EHR].[T_EHR_RUS_SLM365]') 
         AND name = 'TYPE'
)
ALTER TABLE [EHR].[T_EHR_RUS_SLM365] ADD [TYPE] varchar(255) NULL
GO


IF NOT EXISTS (
  SELECT * 
  FROM   sys.columns 
  WHERE  object_id = OBJECT_ID(N'[EHR].[T_EHR_RUS_SLM365]') 
         AND name = 'Synonym_OID'
)
ALTER TABLE [EHR].[T_EHR_RUS_SLM365] ADD [Synonym_OID] varchar(255) NULL
GO