TRUNCATE TABLE PG_CRED_POSICAO_FINANCEIRA_PROCESSAR 
TRUNCATE TABLE RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_CHQ_DEPOS_CPL
TRUNCATE TABLE RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_CHQ_DEVO
TRUNCATE TABLE RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_CHQ_LANC_CPL
TRUNCATE TABLE RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_CHQ_REPA_CPL
TRUNCATE TABLE RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_PDV_VD_CANCEL_CONV
TRUNCATE TABLE RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_PDV_VD_CANCEL_TEF
TRUNCATE TABLE RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_PG_CRED
TRUNCATE TABLE RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_PG_DEB
TRUNCATE TABLE RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_RC_CRED
TRUNCATE TABLE RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_RC_CREDIARIO_FECHA
TRUNCATE TABLE RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_RC_PGTO_PDV
TRUNCATE TABLE RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_RC_VD_CONV

INSERT INTO  RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_CHQ_DEPOS_CPL
(CD_EMP,
CD_FILIAL,
DT_PROC,
DT_CAD,
DT_ULT_PROC)
SELECT
	CD_EMP,
	0,
	MIN(DT_INI_SISTEMA),
	GETDATE(),
	NULL
FROM
	PRC_FILIAL
WHERE
	NOT DT_INI_SISTEMA IS NULL
GROUP BY
	CD_EMP

INSERT INTO RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_CHQ_DEVO
(CD_EMP,
CD_FILIAL,
DT_PROC,
DT_CAD,
DT_ULT_PROC)
SELECT
	CD_EMP,
	0,
	MIN(DT_INI_SISTEMA),
	GETDATE(),
	NULL
FROM
	PRC_FILIAL
WHERE
	NOT DT_INI_SISTEMA IS NULL
GROUP BY
	CD_EMP

INSERT INTO RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_CHQ_LANC_CPL
(CD_EMP,
CD_FILIAL,
DT_PROC,
DT_CAD,
DT_ULT_PROC)
SELECT
	CD_EMP,
	0,
	MIN(DT_INI_SISTEMA),
	GETDATE(),
	NULL
FROM
	PRC_FILIAL
WHERE
	NOT DT_INI_SISTEMA IS NULL
GROUP BY
	CD_EMP

INSERT INTO RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_CHQ_REPA_CPL
(CD_EMP,
CD_FILIAL,
DT_PROC,
DT_CAD,
DT_ULT_PROC)
SELECT
	CD_EMP,
	0,
	MIN(DT_INI_SISTEMA),
	GETDATE(),
	NULL
FROM
	PRC_FILIAL
WHERE
	NOT DT_INI_SISTEMA IS NULL
GROUP BY
	CD_EMP

INSERT INTO RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_PDV_VD_CANCEL_CONV
(CD_EMP,
CD_FILIAL,
DT_PROC,
DT_CAD,
DT_ULT_PROC)
SELECT
	CD_EMP,
	0,
	MIN(DT_INI_SISTEMA),
	GETDATE(),
	NULL
FROM
	PRC_FILIAL
WHERE
	NOT DT_INI_SISTEMA IS NULL
GROUP BY
	CD_EMP

INSERT INTO RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_PDV_VD_CANCEL_TEF
(CD_EMP,
CD_FILIAL,
DT_PROC,
DT_CAD,
DT_ULT_PROC)
SELECT
	CD_EMP,
	0,
	MIN(DT_INI_SISTEMA),
	GETDATE(),
	NULL
FROM
	PRC_FILIAL
WHERE
	NOT DT_INI_SISTEMA IS NULL
GROUP BY
	CD_EMP

INSERT INTO RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_PG_CRED
(CD_EMP,
CD_FILIAL,
DT_PROC,
DT_CAD,
DT_ULT_PROC)
SELECT
	CD_EMP,
	0,
	MIN(DT_INI_SISTEMA),
	GETDATE(),
	NULL
FROM
	PRC_FILIAL
WHERE
	NOT DT_INI_SISTEMA IS NULL
GROUP BY
	CD_EMP

INSERT INTO RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_PG_DEB
(CD_EMP,
CD_FILIAL,
DT_PROC,
DT_CAD,
DT_ULT_PROC)
SELECT
	CD_EMP,
	CD_FILIAL,
	DT_INI_SISTEMA,
	GETDATE(),
	 NULL
FROM
	PRC_FILIAL
WHERE
	NOT DT_INI_SISTEMA IS NULL

INSERT INTO RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_RC_CRED
(CD_EMP,
CD_FILIAL,
DT_PROC,
DT_CAD,
DT_ULT_PROC)
SELECT
	CD_EMP,
	CD_FILIAL,
	DT_INI_SISTEMA,
	GETDATE(),
	 NULL
FROM
	PRC_FILIAL
WHERE
	NOT DT_INI_SISTEMA IS NULL

INSERT INTO RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_RC_CREDIARIO_FECHA
(CD_EMP,
CD_FILIAL,
DT_PROC,
DT_CAD,
DT_ULT_PROC)
SELECT
	CD_EMP,
	0,
	MIN(DT_INI_SISTEMA),
	GETDATE(),
	NULL
FROM
	PRC_FILIAL
WHERE
	NOT DT_INI_SISTEMA IS NULL
GROUP BY
	CD_EMP

INSERT INTO RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_RC_PGTO_PDV
(CD_EMP,
CD_FILIAL,
DT_PROC,
DT_CAD,
DT_ULT_PROC)
SELECT
	CD_EMP,
	0,
	MIN(DT_INI_SISTEMA),
	GETDATE(),
	NULL
FROM
	PRC_FILIAL
WHERE
	NOT DT_INI_SISTEMA IS NULL
GROUP BY
	CD_EMP

INSERT INTO RC_DEB_POSICAO_FINANCEIRA_PROCESSAR_RC_VD_CONV
(CD_EMP,
CD_FILIAL,
DT_PROC,
DT_CAD,
DT_ULT_PROC)
SELECT
	CD_EMP,
	0,
	MIN(DT_INI_SISTEMA),
	GETDATE(),
	NULL
FROM
	PRC_FILIAL
WHERE
	NOT DT_INI_SISTEMA IS NULL
GROUP BY
	CD_EMP

INSERT INTO PG_CRED_POSICAO_FINANCEIRA_PROCESSAR
(CD_EMP,
CD_FILIAL,
DT_PROC,
DT_CAD,
DT_ULT_PROC)
SELECT
	CD_EMP,
	CD_FILIAL,
	DT_INI_SISTEMA,
	GETDATE(),
	 NULL
FROM
	PRC_FILIAL
WHERE
	NOT DT_INI_SISTEMA IS NULL