IF OBJECT_ID('dbo.vw_fco_tc_salud') IS NOT NULL
    DROP VIEW dbo.vw_fco_tc_salud
GO
CREATE VIEW dbo.vw_fco_tc_salud
AS
SELECT x.compania, x.anio, x.mes, x.sucursal, x.tipo_planilla, 
x.cod_EPS, a.descripcion AS nombre_EPS, x.nro_aut_IGE, x.suma_aut_IGE, x.nro_aut_LMA, x.suma_aut_LMA, 
x.nro_radicacion, x.saldo_favor_aportes, x.saldo_favor_UPC
FROM fco_integrada_rt04 x
LEFT JOIN vw_fco_administradoras a ON x.compania = a.compania AND x.cod_EPS = a.codigo AND a.tipo = 'EPS'
GO
GRANT SELECT ON dbo.vw_fco_tc_salud TO PUBLIC
GO
