IF COL_LENGTH('AR_AFIP_Fact_Apocrifas', 'Cuit') IS NULL 
BEGIN
	CREATE TABLE AR_AFIP_Fact_Apocrifas (
		Cuit		VARCHAR(19) NOT NULL,
		Fecha		DATETIME,
		Fecha_Pub	DATETIME,
		Descripcion	VARCHAR(500),
		CONSTRAINT PK_AAFFA_PorId PRIMARY KEY (Cuit)
		)
END

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE name='IX_AAFFA_PorFecPub' AND object_id = OBJECT_ID('AR_AFIP_Fact_Apocrifas') )
	CREATE INDEX IX_AAFFA_PorFecPub ON AR_AFIP_Fact_Apocrifas (Fecha_Pub)

