IF OBJECT_ID('RC_CLI_TRANSACAO_EST_ORC') IS NULL 
BEGIN
	CREATE TABLE RC_CLI_TRANSACAO_EST_ORC (
		CD_CTR		BIGINT NOT NULL,
		CD_EMP		INT NOT NULL,
		CD_FILIAL	INT NOT NULL,
		CD_ORC		INT NOT NULL,
		DT_CAD		DATETIME CONSTRAINT DF_RC_CLI_TRANSACAO_EST_ORC_DT_CAD DEFAULT GETDATE() NOT NULL,
		CONSTRAINT PK_RC_CLI_TRANSACAO_EST_ORC PRIMARY KEY (CD_CTR),
		CONSTRAINT FK_RC_CLI_TRANSACAO_EST_ORC_EST_ORC FOREIGN KEY (CD_EMP,CD_FILIAL,CD_ORC) REFERENCES EST_ORC(CD_EMP,CD_FILIAL,CD_ORC),
		CONSTRAINT FK_RC_CLI_TRANSACAO_EST_ORC_RC_CLI_TRANSACAO FOREIGN KEY (CD_CTR) REFERENCES RC_CLI_TRANSACAO(CD_CTR)
	) 
END 