IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_NAME(OBJECT_ID)= 'EST_PED_VD_PAG_DUPLICATA')
BEGIN 

CREATE TABLE [DBO].[EST_PED_VD_PAG_DUPLICATA](
	[CD_CTR] [INT] IDENTITY(1,1) NOT NULL,
	[PAG_CD_CTR] [INT] NULL,
	[CD_EMP] [INT] NOT NULL,
	[CD_COND_PGTO] [INT] NOT NULL,
	[PARCELA] [INT] NOT NULL,
	 CONSTRAINT [PK_EST_PED_VD_PAG_DUPLICATA] 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 [DBO].[EST_PED_VD_PAG_DUPLICATA]  WITH CHECK ADD  CONSTRAINT [FK_EST_PED_VD_PAG_DUPLICATA_EST_PED_VD_PAG] FOREIGN KEY([PAG_CD_CTR])REFERENCES [DBO].[EST_PED_VD_PAG] ([CD_CTR])
ALTER TABLE [DBO].[EST_PED_VD_PAG_DUPLICATA] CHECK CONSTRAINT [FK_EST_PED_VD_PAG_DUPLICATA_EST_PED_VD_PAG]


END 