IF NOT EXISTS (SELECT 1 FROM SYS.TABLES WHERE NAME ='PRC_FILIAL_FILTRO_PERSONALIZADO_CPL')
BEGIN
	CREATE TABLE dbo.PRC_FILIAL_FILTRO_PERSONALIZADO_CPL (
	CD_CTR int DEFAULT 0 NOT NULL,
	CD_EMP int DEFAULT 0 NOT NULL,
	CD_FILIAL int DEFAULT 0 NOT NULL,
	CONSTRAINT PK_PRC_FILIAL_FILTRO_PERSONALIZADO_CPL PRIMARY KEY (CD_CTR,CD_EMP,CD_FILIAL),
	CONSTRAINT FK_PRC_FILIAL_FILTRO_PERSONALIZADO_CPL_PRC_FILIAL_FILTRO_PERSONALIZADO FOREIGN KEY (CD_EMP,CD_FILIAL) REFERENCES dbo.PRC_FILIAL(CD_EMP,CD_FILIAL) ON DELETE CASCADE ON UPDATE CASCADE
);
  
END

GO 