title: Stored Procedure using Where with if else
body: <p>I have been trying to use stored procedure for searching data.   </p>
  
  <pre><code>ALTER PROCEDURE [dbo].[SP_Something]
  (
  @Search_Text VARCHAR(4000),
  @FILTER INT
  )
  AS
  BEGIN  
  SELECT  Customer_Information
  
  FROM Customer
  LEFT OUTER JOIN Something K ON  K.Something _Id= Something_Id2
  
  LEFT OUTER JOIN  Something3 KS ON KS.Something_Id =Something_Id3
  
  WHERE
  
  // If @FILTER=1 i want to search below
  
   Customer_İnformation LIKE '%' + @Search_Text + '%'
  
  // If @FILTER=2 i want to search below
  
  Customer_name LIKE '%' + @Search_Text + '%'
  
  // If @FILTER=3 i want to search below
  
  Customer_Adress LIKE '%' + @Search_Text + '%'
  </code></pre>
  
  <p>How can i use <strong>Where</strong> with <strong>If</strong> conditions ?</p>
  
  <p>Any help will be appreciated</p>
  
  <p>Thank you.</p>