create procedure rrhh.sp_limpiarDetalleBono
@numBono int,
@txtDetallesValidos varchar(6000)
as
begin
	set nocount on;

	declare @sql varchar(6000);

	set @sql = 'UPDATE rrhh.det_bono set estado = 0 where idBono = '+cast(@numBono as varchar)+' AND estado = 1 AND id not in('+@txtDetallesValidos+');';
	exec(@sql);
end