IF NOT EXISTS (
    SELECT 1 
    FROM sys.objects 
    WHERE object_id = OBJECT_ID('dbo.EST_NFE_SOLICIT_APROP_CRED_PRESUMIDO_EST_NF_SAI') 
      AND type = 'U'
)
BEGIN
    CREATE TABLE dbo.EST_NFE_SOLICIT_APROP_CRED_PRESUMIDO_EST_NF_SAI (
        CD_CTR_SOLICIT_APROP_CRED_PRESUMIDO    INT NOT NULL,
        CD_EMP INT NOT NULL,
        CD_FILIAL INT NOT NULL,
        CD_NF INT NOT NULL,
        NR_EVENTO INT NOT NULL,
        CONSTRAINT PK_EST_NFE_SOLICIT_APROP_CRED_PRESUMIDO_EST_NF_SAI PRIMARY KEY (CD_CTR_SOLICIT_APROP_CRED_PRESUMIDO, CD_EMP, CD_FILIAL, CD_NF)
    );
END;
GO
