IF OBJECT_ID('dbo.fco_cias_datos_adi') IS NULL
CREATE TABLE dbo.fco_cias_datos_adi
( 
    compania char(4) NOT NULL,
    tipo_id char(3) NOT NULL, 
    cod_dpto  char(2) NOT NULL,
    cod_ciudad char(3) NOT NULL,
    fax varchar(20) NULL,
    nit_ARP varchar(11) NULL,
    nombre_ARP varchar(30) NULL,
    clase_aportante char(1) NULL,
    forma_presentacion char(1) NULL,
    sucursal_pagadora char(10) NULL,
    nro_patronal char(11) NULL,
    nombre_retenedor varchar(60) NULL,
    cedula_retenedor varchar(60) NULL,
    agencias varchar(300) NULL,
    arp_iss tinyint NULL,
    dir_ARP varchar(50) NULL,
    tel_ARP varchar(20) NULL,
    nombre_SENA varchar(30) NULL,
    nit_SENA varchar(11) NULL,
    dir_SENA varchar(50) NULL,
    tel_SENA varchar(20) NULL,
    nombre_ICBF varchar(30) NULL,
    nit_ICBF varchar(11) NULL,
    dir_ICBF varchar(50) NULL,
    tel_ICBF varchar(20) NULL,
    cod_admon varchar(40) NULL, 
    iss_redondea bit NULL,
    cod_ARP char(6) NULL,
    Constraint PK_cias_datos_adi PRIMARY KEY (compania),  
    Constraint ck_cda_tipid CHECK (tipo_id IN ('NIT','CC','CE')),
    Constraint ck_cda_fpres CHECK (forma_presentacion IN ('C','U','S')),
    Constraint ck_cda_clase CHECK (clase_aportante IN ('P','G'))
)
GO
GRANT ALL ON fco_cias_datos_adi TO PUBLIC
GO

