>Can I set a variable within the CASE statement? I keep getting a syntax error when trying to set a variable within a CASE statement. I need to set a variable at the row level.
Probably the reason that you're having an issues is that CASE is an expression.
SET @var = CASE WHEN 1 THEN 'a' WHEN 2 THEN 'b' ELSE 'c' END
-Mike