title: SQL Server 2005 - Using CASE inside Stored Procedure
body: <p>I'm using a select statement inside a stored procedure. All I need to do is based on the value of a parameter I've to use either RIGHT JOIN or INNER JOIN. Please anyone there help me to achieve this. Many Thanks in Advance..</p>
  
  <pre><code>SELECT FLD1, FLD2  
  FROM TBL1 C (NOLOCK)    
       CASE
         WHEN @SHOW = 156 THEN INNER
         ELSE RIGHT JOIN TBL2 IC (NOLOCK) ON C.FLD3 = IC.FLD4   
       END
  </code></pre>
  
  <p>Is it correct? What would be the right way of doing this?</p>