IF OBJECT_ID('RC_DEB_PAG_VALE_COMPRA') IS NULL
BEGIN
    CREATE TABLE RC_DEB_PAG_VALE_COMPRA
    (
        CD_CTR INT IDENTITY(1, 1) NOT NULL,
        PAG_CD_CTR INT NOT NULL,
        CD_VALE_COMPRA VARCHAR(100) COLLATE Latin1_General_CI_AI NOT NULL,
        TP_ORIGEM INT NOT NULL,
        CONSTRAINT PK__RC_DEB_PAG_VALE_COMPRA
            PRIMARY KEY (CD_CTR),
        CONSTRAINT FK__RC_DEB_PAG_VALE_COMPRA__RC_DEB_PAG
            FOREIGN KEY (PAG_CD_CTR)
            REFERENCES RC_DEB_PAG (CD_CTR)
    );

END;