title: Using CASE Statement in Stored Procedure
body: <p>I have a Stored Procedure that calls other Stored Procedures depending on the Input parameters specified.</p>
  
  <p>This is how it looks:</p>
  
  <pre><code>CREATE PROCEDURE dbo.usp_SPCaller
  @Input_Param1 NVARCHAR(100) = NULL,
  @Input_Param2 NVARCHAR(100) = NULL
  
  AS
  BEGIN
  SET NOCOUNT ON    
  
  IF ((@Input_Param1 IS NOT NULL) AND (@Input_Param2 IS NOT NULL))
     BEGIN
         EXEC dbo.usp_SPWithParam1And2
     END 
  
  IF ((@Input_Param1 IS NOT NULL) AND (@Input_Param2 IS NULL))
     BEGIN
         EXEC dbo.usp_SPWithParam1Only
     END
  
  IF ((@Input_Param1 IS NULL) AND (@Input_Param2 IS NOT NULL))
     BEGIN
         EXEC dbo.usp_SPWithParam2Only
     END
  
  IF ((@Input_Param1 IS NULL) AND (@Input_Param2 IS NULL))
     BEGIN
         EXEC dbo.usp_SPWithoutParam1And2
     END
  </code></pre>
  
  <p>After presenting this to our lead, he advised me to use CASE STATEMENTS instead because using IF STATEMENTS is a bad idea.</p>
  
  <p>I tried searching everywhere on how to use CASE STATEMENTS in the same format as I have above but to no avail. All I find is using CASE STATEMENTS together with UPDATE.</p>
  
  <h2>My question</h2>
  
  <p>How do I use CASE STATEMENTS in SQL SERVER in a way that it looks like the above?</p>