IF	OBJECT_ID('BC_CONCILICAO_BCO_RETORNO') IS NULL
begin

	CREATE TABLE BC_CONCILICAO_BCO_RETORNO
		(NR_LOTE int NOT NULL,
		CD_BC int NOT NULL,
		DT_GER_ARQ datetime NOT NULL,
		SEQ_ARQ int NOT NULL,
		CD_CNT INT NOT NULL,
		CNPJ_FILIAL varchar(15) NOT NULL,
		DS_BANCO varchar(50) NOT NULL,
		COD_CONV_BC varchar(20) NOT NULL,
		AG int NOT NULL,
		CNT int NOT NULL,
		DV_CONTA int NOT NULL,
		SLD_INICIAL_ARQ money NOT NULL,
		DT_INICIAL_ARQ datetime NOT NULL,
		STS_CONT varchar(25) NOT NULL,
		STS_EXTRATO varchar(10) NOT NULL,
		SEQ_REGISTRO int NOT NULL,
		DT_LANCTO datetime NOT NULL,
		VLR_LANCTO money NOT NULL,
		TP_LANCTO int NOT NULL,
		CAT_LANCTO varchar(50) NOT NULL,
		COD_LANCTO int NOT NULL,
		HIST_LANCTO varchar(100) NOT NULL,
		NUM_DOC_LANCTO varchar(40) NOT NULL,
		VLR_LIB_APOS_24H money NOT NULL,
		VLR_LIM_DISP money NOT NULL,
		VLR_LIB_EM_ATE_24H money NOT NULL,
		DT_FIM_SALDO datetime NOT NULL,
		VLR_SLD_FINAL money NOT NULL,
		TOT_DEB money NOT NULL,
		TOT_CRED money NOT NULL,
		STS_CONCILIACAO int NOT NULL
		)  ON [PRIMARY]

	ALTER TABLE BC_CONCILICAO_BCO_RETORNO ADD CONSTRAINT
		PK_BC_CONCILICAO_BCO_RETORNO PRIMARY KEY CLUSTERED 
		(
		NR_LOTE,
		CD_BC,
		DT_GER_ARQ,
		SEQ_ARQ
		) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]


END