
IF NOT EXISTS (SELECT *FROM  TENTACLE_SYNC_TABELAS WHERE TABELA_ORIGEM  = 'V_EST_PROD_INF_DIVERS_TENTACLE')

BEGIN 
	INSERT INTO TENTACLE_SYNC_TABELAS VALUES ('V_EST_PROD_INF_DIVERS_TENTACLE','EST_PROD_INF_DIVERS','EST_PROD_INF_DIVERS','CD_EMP, CD_PROD, OBRIG_RECEITA',1,1,'CD_EMP, CD_PROD')

END  
 
GO 

IF NOT EXISTS (SELECT * FROM SYS.CHANGE_TRACKING_TABLES  WHERE OBJECT_NAME (OBJECT_ID) = 'EST_PROD_INF_DIVERS' ) 
BEGIN 
	ALTER TABLE EST_PROD_INF_DIVERS ENABLE CHANGE_TRACKING;  
END 