I would like to know how I can use local variables in CASE statements in SQL?
CASE
This script gives me an error:
DECLARE @Test int; DE
try this:
DECLARE @Test int; DECLARE @Result char(10); SET @Test = 10; select @Result= CASE @Test WHEN 10 THEN 'OK test' END Print @Result;