If Object_Id('dbo.sp_fco_upd_integrada_cab') Is Not Null
    Drop Procedure dbo.sp_fco_upd_integrada_cab
Go
Create Procedure dbo.sp_fco_upd_integrada_cab
(
    @pch_compania char(4),
    @psi_anio smallint,
    @pti_mes tinyint,
    @pvc_sucursal varchar(10),
    @pch_tipo_planilla char(1),
    @pch_nro_planilla char(10),
    @pdt_fecha_pago smalldatetime
)
As
Begin
    Update fco_integrada_cab
    Set nro_planilla = @pch_nro_planilla,
        fecha_pago_real = @pdt_fecha_pago
    Where compania = @pch_compania
      And anio = @psi_anio
      And mes = @pti_mes
      And sucursal = IsNull(@pvc_sucursal, '')
      And tipo_planilla = @pch_tipo_planilla
End
Go
Grant Execute On dbo.sp_fco_upd_integrada_cab To Public
Go