Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
É possivel fazer algo desse tipo no SQL Server?
where 1=1
case
when @clienteNome is not null then and cliente.cliente like '%'+@clienteNome+'%'
when @classeProcessoId is not null then and (classe_processo.classe_processo_id = @classeProcessoId or classe_processo.classe_processo_id = 0)
when @tipoProcesso is not null then and (tipo_processo.tipo_processo = @tipoProcesso or tipo_processo.tipo_processo = '')
when @equipeId is not null then and (equipe.equipe_id = @equipeId or equipe.equipe_id = 0)
when @recursoId is not null then and (recurso.recurso_id = @recursoId or recurso.recurso_id = 0)
when @parceiroId is not null then and (parceiro.parceiro_id = @parceiroId or parceiro.parceiro_id = 0)
when @device is not null then and (record_call.device = '9000' or record_call.device is null)
when @calledDevice is not null then and (record_call.calleddevice = @calledDevice or record_call.calleddevice is null)
end
Carregando comentários...