Experts i am trying to replace a dynamic sql query inside my sproc with a general statement but using CASE. I am trying to replace if then else and appending to a string with using CASE stmts...I believe that will improve the performance of the query. Is that correct ? I wrote something but incorrect, can u please guide me to correct it ? I hope you understand what i am trying to achieve here.
declare @size integer
select * from size + (case @size<>0 then ',size_scale where size.size_scale_id=size_scale.size_scale_id and size.size_scale_id=@size' end)