IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE NAME = 'EST_PROD_TRILHO_EXCESSO_CANCEL')
BEGIN

	CREATE TABLE [dbo].[EST_PROD_TRILHO_EXCESSO_CANCEL](
		[CD_EMP] [int] NOT NULL,
		[CD_FILIAL] [int] NOT NULL,
		[CD_CTR] [int] NOT NULL,
		[CD_USU] [int] NOT NULL,
	 CONSTRAINT [PK_EST_PROD_TRILHO_EXCESSO_CANCEL] PRIMARY KEY CLUSTERED 
	(
		[CD_EMP] ASC,
		[CD_FILIAL] ASC,
		[CD_CTR] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
	) ON [PRIMARY]

	ALTER TABLE [dbo].[EST_PROD_TRILHO_EXCESSO_CANCEL] ADD  CONSTRAINT [FK_EST_PROD_TRILHO_EXCESSO_CANCEL_EST_PROD_TRILHO_EXCESSO] FOREIGN KEY (CD_EMP, CD_FILIAL, CD_CTR) REFERENCES EST_PROD_TRILHO_EXCESSO (CD_EMP, CD_FILIAL, CD_CTR) ON DELETE CASCADE
END
