I understand how to use a case statement to return different values:
SELECT CASE Color
WHEN 'Blue' THEN 'Water'
WHEN 'Black' THEN 'Oil'
WHEN 'Red' THEN 'Blood'
END
FROM dbo.Liquid
Is there a way to use it to control flow instead of IF-ELSE, i.e.
DECLARE @Color varchar()
SELECT @Color = Color FROM dbo.Liquid WHERE ID = @MyID
CASE (@Color)
WHEN 'Blue' THEN SELECT 'Water'
WHEN 'Black' THEN SELECT 'Oil'
WHEN 'Red' THEN PRINT 'HELP! I''m bleeding!'
END