
IF OBJECT_ID('PDV_VD_TEF_CARTAO_CONV_PEND') IS NULL 
	BEGIN 
		CREATE TABLE [dbo].[PDV_VD_TEF_CARTAO_CONV_PEND](
			[CD_EMP] [int] NOT NULL,
			[CD_FILIAL] [int] NOT NULL,
			[CD_VD] [int] NOT NULL,
			[CD_CTR] [int] NOT NULL	
		 CONSTRAINT [PK_PDV_VD_TEF_CARTAO_CONV_PEND] PRIMARY KEY CLUSTERED 
		(
			[CD_EMP] ASC,
			[CD_FILIAL] ASC,
			[CD_VD] ASC,
			[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].[PDV_VD_TEF_CARTAO_CONV_PEND]  WITH CHECK ADD  CONSTRAINT [FK_PDV_VD_TEF_CARTAO_CONV_PEND_PDV_VD_TEF] FOREIGN KEY(CD_EMP, CD_FILIAL, CD_VD, CD_CTR)
		REFERENCES [dbo].[PDV_VD_TEF] (CD_EMP, CD_FILIAL, CD_VD, CD_CTR)
		ON DELETE CASCADE
		ON UPDATE CASCADE		
	END