

IF NOT EXISTS ( SELECT * FROM SYS.TABLES WHERE NAME = 'PDV_VD_NFCE_INU')
BEGIN 
	CREATE TABLE [dbo].[PDV_VD_NFCE_INU] (
	  [CD_INU]		bigint IDENTITY(1, 1) NOT NULL,
	  [CD_FILIAL]	int NOT NULL,
	  [NR_INICIAL]	int NOT NULL,
	  [NR_FINAL]	int NOT NULL,
	  [MES]			INT ,
	  [ANO]			int NOT NULL,
	  [SERIE]		int NOT NULL,
	  [DT_CAD]		datetime DEFAULT GETDATE() NULL,
	  [CD_USU]		INT NULL, 
	  [VER_APLIC]	varchar(30) NULL,  
	  [DT_RECBTO]	datetime NULL,
	  [NR_PROT]		varchar(100)  NULL,
	  [DIG_VAL]		varchar(30) NULL,
	  [C_STAT]		INT NULL,
	  [X_MOTIVO]	varchar(255)  NULL,
	  [ARQ_XML]		varchar(max)  NULL,
	  [JUSTIFICATIVA] varchar(500)  NULL,
	  CONSTRAINT [PK_PDV_VD_NFCE_INU] PRIMARY KEY CLUSTERED ([CD_INU])
	)
	ON [PRIMARY]
END ; 