 if not exists (select* from sys.tables where name = 'EST_NF_ENT_PEND_ENV_INTEGRACAO') 

begin 
 CREATE TABLE EST_NF_ENT_PEND_ENV_INTEGRACAO(
    ID_CTR           INT IDENTITY(1,1) NOT NULL,
    DTHR_CAD         DATETIME NOT NULL,
	NR_NF            INT NOT NULL,
	DTHR_ENT         DATETIME NOT NULL,
	CD_FORN          INT NOT NULL,
	RZ_FORN          VARCHAR(255) NOT NULL,
	CNPJ             VARCHAR(50) NOT NULL,
    DTHR_CONSULTA    DATETIME NULL,
	HASH_CONSULTA    VARCHAR(50) NULL,
    DTHR_CONFIRMACAO DATETIME NULL,
    HASH_CONFIRMACAO VARCHAR(50) NULL,
    STS_PROCESSO     INT NOT NULL DEFAULT 0,
 CONSTRAINT [PK_EST_NF_ENT_PEND_ENV_INTEGRACAO] PRIMARY KEY CLUSTERED 
(
	[ID_CTR] 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 ; 
 