
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TELE_ORC_PAG_CREDIARIO]') AND type in (N'U'))
begin
	return;
end
else
begin
	CREATE TABLE [dbo].[TELE_ORC_PAG_CREDIARIO](
		[CD_ORC_PAG_CREDIARIO] [int] IDENTITY(1,1) NOT NULL,
		[CD_ORC_PAG] [int] NOT NULL,
		[CD_EMP] [int] NOT NULL,
		[CD_MDL_VD] [int] NOT NULL,
		[QT_PARC] [int] NOT NULL,
	 CONSTRAINT [PK_TELE_ORC_PAG_CREDIARIO] PRIMARY KEY CLUSTERED 
	(
		[CD_ORC_PAG_CREDIARIO] 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_CREDIARIO]  WITH CHECK ADD  CONSTRAINT [FK_TELE_ORC_PAG_CREDIARIO_TELE_ORC_PAG] FOREIGN KEY([CD_ORC_PAG])
	REFERENCES [dbo].[TELE_ORC_PAG] ([CD_ORC_PAG])
	

	ALTER TABLE [dbo].[TELE_ORC_PAG_CREDIARIO] CHECK CONSTRAINT [FK_TELE_ORC_PAG_CREDIARIO_TELE_ORC_PAG]
	
end