 
IF  NOT EXISTS (SELECT * FROM sys.objects 
					WHERE object_id = OBJECT_ID(N'[dbo].[TELE_ORC_PAG_CARTAO_PENDENTE]') 
					AND type in (N'U')) 
BEGIN
	CREATE TABLE [dbo].[TELE_ORC_PAG_CARTAO_PENDENTE](
		[CD_CTR_ID] [int] IDENTITY(1,1) NOT NULL,
		[CD_ORC_PAG_CARTAO] [int] NOT NULL,
		[DT_CAD] [DATETIME] NOT NULL,
	 CONSTRAINT [PK_TELE_ORC_PAG_CARTAO_PENDENTE] PRIMARY KEY CLUSTERED 
	(
		[CD_CTR_ID] 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_CARTAO_PENDENTE]  WITH CHECK ADD  CONSTRAINT [FK_TELE_ORC_PAG_CARTAO_TELE_ORC_PAG_CARTAO_PENDENTE] FOREIGN KEY([CD_ORC_PAG_CARTAO])
	REFERENCES [dbo].[TELE_ORC_PAG_CARTAO] ([CD_ORC_PAG_CARTAO]) ON DELETE  CASCADE ;
	ALTER TABLE [dbo].[TELE_ORC_PAG_CARTAO_PENDENTE] CHECK CONSTRAINT [FK_TELE_ORC_PAG_CARTAO_TELE_ORC_PAG_CARTAO_PENDENTE] 
END


