Listing 1: CASE Expression That Passes a Stored Procedure Reference to the EXECUTE Command DECLARE @state char(2) ,@sp SYSNAME -- Examine the value of @state and set @sp to the -- appropriate stored procedure name. SELECT @sp = CASE @state WHEN 'WA' THEN 'first_sp' WHEN 'KS' THEN 'second_sp' WHEN 'TN' THEN 'third_sp' END EXECUTE(@sp) -- dynamic execution of the stored procedure