I'm trying to run this sp but... I cannot figure out where is the mistake. can you help me?
alter procedure prova @condizione=1, @parametro=39
@condizione1 int,
@parametro int
as
begin
declare @condizione int
set @condizione = @condizione1
SET NOCOUNT ON
select pf.CostumerCode, pf.BelongTo
from tbprodfin pf
where
CASE @condizione
WHEN 1 THEN pf.IdPF
WHEN 2 THEN pf.BelongTo
END = @parametro
end