IF NOT  EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CTB_APURA_PIS_COFINS]') AND type in (N'U'))
BEGIN

	CREATE TABLE [dbo].[CTB_APURA_PIS_COFINS](
	[CD_EMP] [int] NOT NULL,
	[CD_FILIAL] [int] NOT NULL,
	[COD_CRED] [int] NOT NULL, 
	[TIPO_REGISTRO] [int] NOT NULL,
	[MES_APURAC] [int] NOT NULL,
	[ANO_APURAC] [int] NOT NULL,
	[CST_PIS] [int] NOT NULL,
	[CST_COFINS] [int] NOT NULL,
	[VLR_RECEITA_BRUTA] [money] NULL,
	[VLR_BASE_PIS] [money] NULL,
	[PERC_ALIQ_PIS] [money] NULL,
	[VLR_PIS] [money] NULL,
	[VLR_BASE_COFINS] [money] NULL,
	[VLR_COFINS] [money] NULL,
	[PERC_ALIQ_COFINS] [money] NULL,
	[QUANT_BC_TOT] [money] NULL,
	[VLR_PIS_REDUC] [money] NULL,
	[VLR_COFINS_REDUC] [money] NULL,
	[VLR_ISENTAS] [money] NULL,
	[NAT_BC_CRED] [int] NULL,
	[DT_CAD] [datetime] NULL,
	[CD_USU] [int] NULL,
	[CD_USU_ALT] [int] NULL,
	[DT_ALT] [datetime] NULL

	CONSTRAINT [PK_CTB_APURA_PIS_COFINS] PRIMARY KEY CLUSTERED
	(
	[CD_EMP] ASC,
	[CD_FILIAL] ASC,
	[MES_APURAC] ASC,
	[ANO_APURAC] ASC,
	[COD_CRED] ASC,
	[TIPO_REGISTRO] ASC,
	[CST_PIS] ASC,
	[CST_COFINS] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY]

END