Hello Experts i have A Sp , which Contains lot of if/else Condition Please help me how to use Switch Case in T-SQL In where Clause. here is my Query
if (@Form ='page.aspx')
begin
select 
    DT.Column,DST.Column1,
    DST.Code  from Table DT
join Table2 DST 
    on DT.ID= DST.ID
where 
    DT.code = 'XX1'
    and DT.CDID = @cdid
end
 if (@Form ='Page2.aspx')
begin
select 
    DT.Column,DST.Column1,
    DST.Code  from Table DT
join Table2 DST 
    on DT.ID= DST.ID
where 
    DT.code = 'XX2'
    and DT.CDID = @cdid
end
Please Help me, Any pointer or suggestion would be really helpful thanks