

IF OBJECT_ID('RC_DEB_PAG_NCC', 'U') IS  NULL
BEGIN


    CREATE TABLE RC_DEB_PAG_NCC
    ( CD_CTR 		INT IDENTITY(1,1) NOT NULL, 
      PAG_CD_CTR 	INT NULL,
      CD_CTR_NCC  	INT NOT NULL,
      CONSTRAINT PK_RC_DEB_PAG_NCC PRIMARY KEY CLUSTERED 
        (
            CD_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]

    ALTER TABLE RC_DEB_PAG_NCC  WITH CHECK ADD  CONSTRAINT FK_RC_DEB_PAG_NCC_RC_DEB_PAG FOREIGN KEY(PAG_CD_CTR) REFERENCES RC_DEB_PAG (CD_CTR)
	ALTER TABLE RC_DEB_PAG_NCC CHECK CONSTRAINT FK_RC_DEB_PAG_NCC_RC_DEB_PAG;

    ALTER TABLE RC_DEB_PAG_NCC  WITH CHECK ADD  CONSTRAINT FK_RC_DEB_PAG_NCC_PDV_VD_DEV_NCC FOREIGN KEY(CD_CTR_NCC) REFERENCES PDV_VD_DEV_NCC (CD_CTR_NCC)
	ALTER TABLE RC_DEB_PAG_NCC CHECK CONSTRAINT FK_RC_DEB_PAG_NCC_PDV_VD_DEV_NCC;

END