 

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

BEGIN 
	INSERT INTO TENTACLE_SYNC_TABELAS VALUES ('V_EST_FISCO_ENV_TENTACLE','EST_FISCO_ENV','EST_FISCO_ENV','CD_EMP, CD_FILIAL, CD_CX, CD_CTR',0,0,'CD_EMP, CD_FILIAL, CD_CX, CD_CTR')

END  
 
GO 

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