IF OBJECT_ID('dbo.fco_fantasmas') IS NOT NULL
    DROP TABLE dbo.fco_fantasmas
GO
CREATE TABLE dbo.fco_fantasmas
(
    compania    char(4) NOT NULL,
    trabajador  char(10) NOT NULL,
    anio        smallint NOT NULL,
    mes         tinyint NOT NULL,
    sucursal    char(10) NOT NULL,
    tipo_planilla char(1) NOT NULL DEFAULT 'E',
    tipo_id     char(2) NOT NULL,
    nro_id      varchar(16) NOT NULL,
    tipo_cotizante tinyint NULL,
    primer_apellido varchar(20) NOT NULL,
    segundo_apellido varchar(30) NOT NULL,
    primer_nombre varchar(20) NOT NULL,
    segundo_nombre varchar(30) NOT NULL,
    AFP         char(10) NOT NULL,
    EPS         char(10) NOT NULL,
    CCF         char(10) NOT NULL,
    CTR         char(10) NOT NULL,    
    dias_AFP    tinyint NOT NULL,
    dias_EPS    tinyint NOT NULL,
    dias_ARP    tinyint NOT NULL,
    dias_CCF    tinyint NOT NULL,
    salario     decimal(9,0) NOT NULL,
    IBC_AFP     decimal(9,0) NOT NULL,
    IBC_EPS     decimal(9,0) NOT NULL,
    IBC_ARP     decimal(9,0) NOT NULL,
    IBC_CCF     decimal(9,0) NOT NULL,
    aporte_AFP  decimal(9,0) NOT NULL,
    aporte_FSP_sol  decimal(9,0) NOT NULL,
    aporte_FSP_sub  decimal(9,0) NOT NULL,
    aporte_EPS  decimal(9,0) NOT NULL,
    UPC_adicional decimal(9,0) NOT NULL,
    tarifa_ARP decimal(9,8) NOT NULL,
    aporte_ARP  decimal(9,0) NOT NULL,
    aporte_CCF	decimal(9,0) NOT NULL,
    aporte_SENA	decimal(9,0) NOT NULL,
    aporte_ICBF	decimal(9,0) NOT NULL,
    aporte_ESAP	decimal(9,0) NOT NULL,
    aporte_MEdu	decimal(9,0) NOT NULL,
    extranjero char(1) NOT NULL,
    residente_exterior char(1) NOT NULL,
    departamento char(2) NOT NULL,
    municipio char(3) NOT NULL,
    planilla_pens bit NOT NULL,
    CONSTRAINT PK_fco_Fantasmas PRIMARY KEY NONCLUSTERED (compania, trabajador)
)
GO
GRANT ALL ON fco_Fantasmas TO PUBLIC
GO


