IF  NOT EXISTS (SELECT * FROM sys.objects 
					WHERE object_id = OBJECT_ID(N'[dbo].[TELE_ORC_PAG_DUPLICATA]') 
					AND type in (N'U')) 
BEGIN
	CREATE TABLE [dbo].[TELE_ORC_PAG_DUPLICATA](
		[CD_ORC_PAG_DUPLICATA] [int] IDENTITY(1,1) NOT NULL,
		[CD_ORC_PAG] [int] NOT NULL,
		[CD_EMP] [int] NOT NULL,	
		[CD_COND_PGTO] [int] NOT NULL,
		[QT_PARC] [int] NOT NULL,
	 CONSTRAINT [PK_TELE_ORC_PAG_DUPLICATA] PRIMARY KEY CLUSTERED 
	(
		[CD_ORC_PAG_DUPLICATA] 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].[TELE_ORC_PAG_DUPLICATA]  WITH CHECK ADD  CONSTRAINT [FK_TELE_ORC_PAG_DUPLICATA_TELE_ORC_PAG] FOREIGN KEY([CD_ORC_PAG])
	REFERENCES [dbo].[TELE_ORC_PAG] ([CD_ORC_PAG]) 
	ALTER TABLE [dbo].[TELE_ORC_PAG_DUPLICATA] CHECK CONSTRAINT [FK_TELE_ORC_PAG_DUPLICATA_TELE_ORC_PAG] 
END


